Divi launches API for developers • WordPress Help

With the arrival of version 3.1, Divi has brought to light a complete API for developers that will mark the future of this visual designer, greatly facilitate the programming of modules for the well-known and popular theme and visual constructor.

Divi Developer API

The new API has an immense documentation and tutorials as well as a utility of creation of extensions for Divi to make it easier to make your own Divi modules.

The importance of this movement is vital, since ] opens the door to the creation of third-party modules and a huge ecosystem around the popular layout .

With the new API you can create modules and extensions for Divi suited to your needs or those of your clients . In addition, using a custom React component, you can preview your module in the layout as you program it.

Compatibility

There are already lots of modules of other programmers for Divi, but until now these modules did not work well in the cover visual mode, and could only be edited in the classic constructor.

With this new tool those same modules can be updated to work in the editor too visual, as in the classic.

Learn to program with Divi

As for the documentation for developers, include step-by-step tutorials that teach you how to create your own modules for Divi, as well as offering a complete look at the Divi API.

Even if you're just starting out with web development, the tutorials for beginners guide you through the whole process.

The new extension creation tool

With the new extension creation utility for Divi a fast creation model of custom modules for Divi is included.

With a single command you set the development environment in motion, install dependencies and create a React base application with a WordPress plugin that has all the files and structure that allows you to register it for use with Divi and WordPress.

a basic module that works from the first moment. From there you only have to configure your extension and configure your module. When you finish, with a single command you optimize your extension and leave it ready for production.

This new utility is open source, and is based on the Create React application. You can use it, copy it, modify it, whatever you want.

An example to learn

In addition to the extensions creation utility, the people of Elegant Themes have also created a basic example of extension for Divi ] That you can use to learn from it.

It is an example of how a module for Divi should be created. If you like to learn by revising code you will love it.

Divi has prepared for the future

Closed tools have no future, and if you want to have a future you must open your code to others. It is the model of Android versus that of Microsoft or Apple, and the new API and tools for Divi are a great step to open this technology to others and thus make the layout even bigger, taking it to where each programmer wants to reach.

A very smart move.

Loading …

That may also help you:

How to create a custom color palette for the Gutenberg editor

You already know that I'm not especially a big fan of the editor Gutenberg . Not from his philosophy of introducing visual editing to WordPress, which you know it is, that I think is necessary, but of how to implant it by noses and from its first versions, as a substitute for the default editor in the tickets, a big mistake.

Now, one thing does not take away the other, and is going to touch us, yes or yes adapt, so better to learn things, tricks, from the editor Gutenberg like this one that I propose to you today, I do not know if by conviction or because José Ángel Vidania has abducted me .

Well, one of the curiosities that the Gutenberg editor incorporates is ] the color palettes which by default is like this:

What you do not know is that these color palettes can be customized either because you use a special combination on your website, because you are a developer of themes, or simply because you like to get involved. [1 9659003] In either case, it is very easy to add your own color palette . You just have to edit the file functions.php of the theme and add something like this:

When saving your changes what you will get is the following:

Logically, in the code put the colors (in hexadecimal) you want in your color palette. Here I opted for two shades of magenta, a light gray and a dark gray (basic).

As you see, customize Gutenberg is very easy and you have to thank the development team huge documentation that is generating for this new and brand new WordPress editor, like it or not.

Loading …

That may also help you:

Hides the WordPress login screen without plugins

One of the basic security measures in WordPress is to hide the access screen and / or WordPress registry, to avoid brute force attacks and simply make it more difficult for hackers.

The reason

The reason why it is important to hide the WordPress login screen is because most hackers use ] searchers seeking addresses of type /wp-login.php or / wp-admin / accessible in which to launch their automatic detection machines and user test and passwords .

By hiding your login screen for something other than the WordPress standard you remove thousands of these lazy attackers using applications to hack installations by WordPress.

The solution (s)

]

A very common solution for the WordPress administrator is to use security plugins such as iThemes Security or All in One WP Security which include utilities to hide the screen access, and it's not bad solution.

But what I propose today is get the same without plugins in case you do not need the other thrice ] utilities of the security plugins.

The code

What we are going to do is create a redirection of the WordPress access screen to a URL of our choice. For this we will use the file .htaccess .

Search it in the root directory of your WordPress installation and open it with your favorite FTP application or from the panel of your hosting.

Next adds the following lines better before where are the rewrite from WordPress ( #BEGIN WORDPRESS ):

Important notes

] The above code is an example, so there are things you must change :

  • On line 2 you must change milogin by the slug of your personalized access URL ( ] access entry whatever you want). The idea is that your access URL will be from here https://yourdomain.com/milogin or whatever you have chosen, for example, https://yourdomain.com/ access .
  • On lines 2 and 7 you must change the key with 123abc for something else. It's a hidden key that hackers will not see. The only rule is to use the same in both lines and use only letters and numbers.

And that's it. Save the changes and check that it works. If after saving you see a error 500 on your website it will be that something has been wrong with the code, please review it and modify it.

Loading …

That may also help you:

WooCommerce 3.4 incorporates RGPD support • WordPress Help

Although plugins are already coming to light adapt your online store to RGPD it seems that WooCommerce also the batteries have been installed and its next version, the 3.4, will incorporate new features to help our Ecommerce comply with the new European regulation [1945900].

Scheduled for May 23, only 2 days before the entry into force of the RGPD (yes, quite fair), WooCommerce 3.4 has some interesting developments despite being a minor update.

Compatibility with the RGPD

This new version has included a new tab of adjustments to help managers of online stores with WordPress to meet the RGPD .

In this tab, in addition to unify several settings that were previously divided between the options of finalizing purchase and configuration of the accounts some additional settings have been included:

  • Possibility of adding the privacy text to the pages of My account and Finalize purchase
  • Integration with [19659010] exporter of data that will come soon in WordPress also to meet the RGPD
  • Tools for clean (delete) and anonymize old orders that do not need more billing processes
  • Tools with which remove optional fields at the end of purchase in the process of payment

Taking a look at captures of the first beta, already available, we will have these adjustments …

The first and second part of the adjustments is a revision of those account creation options that we previously had spread over other adjustment tabs.

Below we can (and should) specify the page with our policy of and privacy to then write the visible text in the first layer of privacy information on both the registration page and the payment page.

Here we can use the shortcode [privacy_policy] to automatically add a link to our privacy policy page

To finish, we can also specify how often we want to send to the wastebasket or to make anonymous customer data .

]

As regards the integration with the WordPress data export tool which will be available in WordPress 4.9.6, WooCommerce will be compatible with it, being able to export the data related to transactions of the online store.

According to the first sketches, this tool could be something like that …

And as for the possibility of customizing which fields will be seen or not at the end of the purchase, est to functionality you will see it in the Customizer . as with the personalization of the privacy texts.

Will there be more changes in WooCommerce 3.4?

Yes. Although it is a minor revision there will be other changes, in this case not related to the RGPD.

Changes in the payment gateway settings

Now there are all the options integrated each one in the tab of each gateway, and one page where you can change your order in the payment, and access the settings of each.

GeoLite2

WooCommerce uses the MaxMind GeoLite database for geolocation during the payment, in order to automatically determine the customer's country in the payment.

But it turns out that the GeoLite database has been abandoned by MaxMind and now it has been replaced by GeoLite2, which will be the one that incorporates compatibility WooCommerce.

Once installed, as before, you no longer have to do updates, they are automatic.

A new requirement is that GeoLite2 requires at least version 5.4 of PHP, so if you have not updated PHP it will not be possible. ás to use geolocation in WooCommerce with GeoLite2.

In these sites the REST API will be used to geolocate, which is a slower method, so I recommend that better update PHP, which is easy and has many benefits

Multisite Desktop Widget

If you have a WordPress multisite installation with several online stores with WooCommerce, from the main site you will now have a widget that will display the latest orders from the entire network.

More improvements

Other improvements and changes in WooCommerce 3.4 are as follows:

  • Restriction of coupons via e-mail jokers . Now, using wildcards, you can set up coupons to associate them with similar emails. For example, students, corporate emails, etc.
  • Users can now choose their visible name on the page of My account .
  • Improvements in the search of products in administration including support for empty words and search for multiple products in the same query.
  • HTTPS notice required in administration. So you already know, if you do not have an SSL yet and you're late installing it .
  • Now you can use product IDs and categories in shortcodes instead of just slugs.
  • Many more improvements

Obsolete functions and methods

As with every update, there are methods and functions that have become obsolete:

  • WC_Geo_IP is obsolete. Review above the change to GeoLite2
  • WC_Widget_Product_Tag_Cloud :: _ get_current_taxonomy obsolete by WC_Widget_Product_Tag_Cloud :: get_current_taxonomy .
  • WC_Widget_Product_Tag_Cloud :: _ topic_count_text is obsolete by ] WC_Widget_Product_Tag_Cloud :: topic_count_text .

Dates

It is estimated that the definitive candidate version will be on May 9, and the public version on May 23.

Loading …

Maybe you too help:

How to disable payment gateways according to the shipping method

There are many and diverse reasons why a manager of an Ecommmerce may want to deactivate specific payment gateways according to the shipping method .

In this article we will see how, by means of a few lines of code, you can deactivate payment gateways based on the shipping method chosen by the customer in the time of payment.

In this example we will deactivate the payment gateway ' bacs ' (bank transfer) for the shipping method ' local_pickup ' (collection local).

To begin we need to have the ID of both the payment gateway and the shipping method.

To know the IDs of the payment gateways you can see them in the corresponding settings section to the available payment gateways and the met shipping period. Just go to WooCommerce> Settings> Finish purchase below all, next to the gateways you will see their IDs

Get the IDs of the shipping methods is something more complicated . To do this you must open the Navigator Inspector and identify the attribute value of each radio button available.

So, for example, you will see that the ] value of the local Pickup button is local_pickup which is the ID of that shipping method .

Now we just have to add the following code ] to our utilities plugin or to the file functions.php of the active theme.

In this way, when you deactivate it and erase it, that constant will erase the, nothing less than, 16 tables that you add to your database these:

  1. wp_wc_download_log
  2. wp_wc_webhooks
  3. wp_woocommerce_api_keys
  4. wp_woocommerce_attribute_taxonomies
  5. wp_woocommerce_downloadable_product_permissions
  6. wp_woocommerce_log
  7. wp_woocommerce_order_itemmeta
  8. wp_woocommerce_order_items
  9. wp_woocommerce_payment_tokenmeta
  10. wp_woocommerce_payment_tokens
  11. wp_woocommerce_sessions
  12. wp_woocommerce_shipping_zones
  13. wp_woocommerce_shipping_zone_locations [19659005] wp_woocommerce_shipping_zone_methods
  14. wp_woocommerce_tax_rates
  15. wp_woocommerce_tax_rate_locations [196590] 07] Then delete that line from your wp-config.php .

    Otherwise, if you have already deactivated and deleted the plugin you will have to delete the tables manually from PHPMyAdmi n, either one by one or by selecting the previous ones all at once, as in the following screenshot …

     delete tables wordpress

    Important note : Before modifying and / or deleting anything in the database beam Backup

    Yoast SEO

    Another of the most popular plugins also leaves a lot of residue if you uninstall it.

    Yoast SEO creates 2 tables:

    • wp_yoast_seo_links
    • wp_yoast_seo_meta

    But it also stores information in :

    • wp_usermeta – meta_key values ​​as wpseo_title.
    • wp_postmeta – meta_key values ​​for several input IDs, including:
      1. _yoast_wpseo_linkdex
      2. _yoast_wpseo_title
      3. _yoast_wpseo_metadesc
      4. _yoast_wpseo_focuskw
      5. _yoast_wpse o_focuskw_text_input
      6. _yoast_wpseo_primary_category
      7. _yoast_wpseo_content_score

    And all this after deactivating and deleting.

    Akismet

    Akismet stores lots of data in table wp_commentmeta that will remain there after deleting the plugin. And I'm talking about thousands of lines .

    EWWW Image Optimizer

    This plugin for optimizing images, after deleting it, stores routes to your images, in their original size, the size after compressing them and the percentage of reduction.

    Everything saved in a single table, wp_ewwwio_images .

    You will also have to manually delete the folder ewww within wp-content

    And the shortcodes?

    Another one of the dump that plugins usually leave when you uninstall them are the shortcodes that use to show contents of any kind.

    This is another additional task that you will have to perform usually looking at the input screen for the shortcode of the plugin, and then editing the entry that contained it. [19659003]  delete shortcodes wordpress [19659] 138] Summing up, what do I do? </span></h2>
<p> Well, if you have read all of the above, I would summarize it like this: </p>
<ol start=

  16. First of all back up the database and files
  17. Go to your Desktop> Plugins and disable the plugin
  18. Also in Desktop> Plugins delete the plugin
  19. Delete any folder and / or additional file that installed the plugin
  20. Delete any table from the database that the plugin added when installing it
  21. If you used shortcodes, search for them and delete them from your entries and / or pages
  22. Check the wp_options table to see if you have left your own lines

That the Codex I will accompany you and force you, you will need it.

Loading …

That may also help you:

How to fix the "Error establishing a connection to the database" in WordPress

One of the ugliest errors you can find in WordPress is the one that says " Error establishing a connection to the database ", basically because it is a blank screen that leaves no room for action on it, something must be done, but behind the scenes.

Although this error is quite radical in the result you see (your entire site has disappeared ) is usually not hard to fix .

The first thing you should know, before panicking, is that it's quite likely that your data is still alive and safe, so , take a deep breath and let's get down to work, okay?

What does "Error establishing a connection to the database?"

The ugly mistake!

To begin with, it is important that you know the mechanisms that are behind the error.

In WordPr There are two main parts:

  • The HTML / PHP code – This is what controls how your site and its features look.
  • Your database – It's where all the information is stored of your entries, pages, settings, comments, and everything else.

When a user comes to your site the HTML / PHP part of WordPress consults in your database to know what content to insert in HTML / PHP. [19659003] So the first thing that WordPress does is consult the database and for that you need to establish a connection with the database.

Offline, WordPress does not You could access any of the content you have to show your visitors. So if WordPress is not able to establish a connection to the database, specified in your file wp-config.php shows you that ugly error .

we have a first place to look!

What causes the "Error establishing a connection to the database?

Once we know what the message really means we will begin to investigate to see why the error is showing on your site.

If you just installed WordPress, you probably entered the database credentials wrong.

But if you see the error in a WordPress site already running, there are other possible guilty:

  • Your database is corrupt. Sometimes, WordPress will show this error if your database is corrupted. Next we see how to check this, do not worry.
  • Your credentials to access the database are not correct. If you have recently changed your credentials to the database you will see this error if you forgot the credentials or did not add them to your file wp-config.php . They could also be errors with the user's permissions to access the database.
  • You are having a problem with your hosting provider . There are some other possible problems that could also cause this error.

Seen this, we will see how to solve each of the possible problems.

How to fix a corrupted database

There is a simple trick that will tell you if the problem is causing a corrupted database:

Try accessing your WordPress desktop, wp-admin

If the error message changes to "One or more tables the database is not available "then you have been lucky, you have to repair the database!

That means that the database is really corrupt, not that there is a broken connection to the database. On the contrary, if the error message does not change, you should go to the next section of this article .

To fix your corrupt database you will have to do 2 things:

  • Add a code to your file wp-config.php to activate the repair tool.
  • Run this repair tool.

So to start, open your favorite FTP program or the file manager panel of your hosting to edit the file wp-config.php . In this article I will use the file manager, which is what you will have on hand, and you do not need to install any additional program or learn to use it.

Go to the panel of your hosting and look for the File Manager ]then locate the site affected by the error.

In the root folder of your WordPress installation with the problem click on the file icon wp-config.php ] and, at the top of the file manager, click on the Code Editor.

When the file wp-config.php is open in the code editor add the following code before the line that says that " That's all, stop editing! Happy blogging ":