Getting Started Technical Problems with WordPress Integration

Technical Problems with WordPress Integration

You are using an obsolete PHP version

This is what the user sees

 

obsolete_php.png

 

Reason

The older PHP version that does not support new programming language capabilities used in one of the libraries. 

 

Solution

Update PHP. Currently, the minimum allowable version for our plugin is PHP 5.5.9. WordPress developers recommend using PHP 7.

Version 5.5 is too old, it was released in 2013, and critical vulnerabilities are not secured in it. The life cycle of versions is available here.

PHP version update is usually available as an option in your hosting provider control panel (Cpanel, ISPManager and others). It takes a few minutes and should not affect your website performance. Nonetheless, you can back up to the previous PHP version if something goes wrong.

You can find detailed instructions on the PHP version update from the major Wordpress platforms below:

BluehostDreamhostSiteground, IPageHostgator, 1&1, Ehost, MediaTemple, GoDaddy, Pagely.

If you can’t find your provider in this row, please, contact your web hosting customer support or system administrator.

After updating the PHP version deactivate Setka Editor plugin and activate it again.

  

The plugin files were partially downloaded 

When the plugin is not fully downloaded (i.e. when not all plugin files were copied to the server), errors occur in PHP. This happens if FTP was uploaded manually and the connection was lost.

 

This is what the user sees

In most cases, the user will see a white page with or without errors. An error message can be seen if WP_DEBUG is active (otherwise you will get a simple white page) or if you look into error.log on the server (full address to the file depends on the server configuration), provided this log is enabled in web server settings.

Warning: include(/var/www/wordpress/htdocs/1/wp-content/plugins/setka-editor/source/Plugin.php): failed to open stream: No such file or directory in /var/www/wordpress/htdocs/1/wp-content/plugins/setka-editor/vendor/composer/ClassLoader.php on line 412

Warning: include(): Failed opening '/var/www/wordpress/htdocs/1/wp-content/plugins/setka-editor/source/Plugin.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/wordpress/htdocs/1/wp-content/plugins/setka-editor/vendor/composer/ClassLoader.php on line 412

Fatal error: Class 'Setka\Editor\Plugin' not found in /var/www/wordpress/htdocs/1/wp-content/plugins/setka-editor/plugin.php on line 30

Reason

Some files were either not downloaded or deleted. Another possible reason is that some files have incorrect content (for example, they were edited manually and their content was deleted).

Solution

Delete the plugin completely. If some files are missing, you will not be able to do this via the plugins control panel since some files are used to delete plugin settings.

If the plugin cannot be deleted via the control panel, then simply delete the plugin’s folder from the server via FTP (SFTP or SSH) and then upload the latest version of the plugin again. You can upload a new version of the plugin in any convenient way, via the control panel or simply via FTP.

 

 

The uploaded file exceeds the permitted size

 

Screen_Shot_2017-04-14_at_17.40.23.png

 

 

This is what the user sees

When trying to upload the plugin via the WordPress administrator panel, you see the message.

Are you sure you want to do this?

Please try again.

Note: this text is taken from WordPress 4.7, the error message looks differently in older versions.

Solution

Check the maximum upload file size settings. The easiest way to do this is to go to the Upload New Media page. The maximum upload file size will be specified at the very bottom of the page. For example: "Maximum upload file size: 3 MB.".

The maximum file size must be larger than that of the ZIP archive with the plugin.

In order to change this setting, contact the host technical support and ask them to increase the size of files allowed for uploading (for example, up to 20 Mb).

In cases where a member of technical support does not know what to do or you would like to make changes on your own, find the php.ini file and make two changes. The php.ini file is usually located in /etc/php/apache2/php.ini (however, it can be located somewhere else depending on the server’s operating system and configuration).

Two settings need to be changed in the file. They can have various values but post_max_size must not be less than upload_max_filesize. You can set any number, for example, 1024M (gigabyte).

Note: after making changes in the file, restart the web server or PHP-FPM (depending on the server’s configuration) for new settings to come into effect. If everything was done correctly, then you will see a different value on the Upload New Media page.

Sometimes, these settings can be specified several times in various locations (for example, in the .htaccess file or other PHP configurations) and values can be rewritten from php.ini. This setting can also be redefined by some WordPress plugins or even a theme (although, it is highly unlikely).

upload_max_filesize = 3M

post_max_size = 3M

 

 

Inactive settings page

This is what the user sees

One of the settings pages of our plugin cannot be opened/accessed.

Reason

Such issue occurs when using HHVM and its settings.

Solution

Add the line below to the HHVM configuration.

hhvm.libxml.ext_entity_whitelist = file,http 

A more detailed description and discussion of the problem is available here.

 

Wp-admin is blocked

This is what the user sees

Updates for styles are not delivered. New themes do not appear. The editor has stopped working. The plugin shows that the subscription has expired and the editor cannot be opened.

Reason

Setka’s API failed to deliver updates to the site with updated CSS and JS files, as well as failing to update information on the subscription renewal. This can occur for several reasons:

 

  • When API accessed the site, the server was unavailable (switched off, heavily loaded, no Internet access) or malfunctioning.
  • Access to the wp-admin/admin-post.php file was blocked from the server’s side or by WordPress.
  • The current version of the plugin is too old and not supported by the Setka’s current API.
  • The domain name you entered is incorrect. Make sure, that link to your domain name is valid. If your website works on https://, make sure that URL starts with https://

Solution

Check with the host’s technical support whether a network firewall is active or other access restrictions to the wp-admin/admin-post.php file are enabled. External connections to this file must be permitted for everything to work correctly.

Plugins can also block access. For example, some plugins restrict access to files in the wp-admin folder if the user is not authorized. Lockdown WP Admin is one of such plugins.

POST, GET, PUT and other similar queries to the wp-admin/admin-post.php file must be permitted. A more detailed description of this file and relevant queries are available in the WordPress codex.  

In order to check the possibility to connect manually, please open http://your-domain.com/wp-admin/admin-post.php page, having specified your domain. If the web-inspector on the Resources tab at the Request & Response section reads ‘Status OK, Code 200,’ then everything is most likely fine.

 

Installed Lockdown WP admin plugin

This is a special case of the problem described above. However, if the Lockdown plugin is used by many users, we examine this case separately.

Solution

Write the following code in any other plugin, theme, or mu-plugin.


function lockdown_wp_admin_no_check_files_2016_12_29($files) {
   $files[] = 'admin-post.php';
   return $files;
}
add_filter('no_check_files', 'lockdown_wp_admin_no_check_files_2016_12_29');

Check the code’s functionality by opening example.com/wp-admin/admin-post.php page. If a white page opens up, then everything works fine. If you see the 404 page, then the code did not work. It is possible if you added it to a file that was not connected to WordPress.

 

Styles and fonts do not work

This is the user sees

When viewing the site outside CMS, you can see that the makeup of posts ‘falls apart’ and all elements from Setka Editor have no styles (i.e. a post looks like a simple text).

Reason

All CSS and JS files in the theme were not activated according to the common WP practice, hence third-party plugins cannot add or remove the necessary files.

Solution

There are two solutions to this problem:

  • Correct the CSS and JS files connection logic inside the theme according to WordPress developers’ recommendations. This approach achieves the same result as what we have now, i.e. this approach does not impose technical restrictions. Remove all hard-connected CSS and JS files inside the raw_header.php file (usually, files of such type in themes are named ‘header.php’), and remove all logic for their addition to separate files. Add the call of the wp_head()function inside the <head> section.
  • If you do not want to rewrite a theme, then activate CSS from Setka Editor manually. There are two ways to do this, however, we have done it as described below on the test site. We created an additional file called ‘setka-editor-resources.php.’ It is connected to raw-header.php. Contents of the file with comments are given below.


Note 1. The method described below only enables a CSS file. In order to enable TypeKit fonts, it is necessary to enable their JS in a similar manner (currently, the Paper does not use TypeKit, that’s why the example does not have it).


<?
php
// Added by Setka Editor team
function setka_editor_print_head_resources() {
   global $wp_styles;
// Checking if there is an enabled Setka Editor plugin
  // And the function that we want to call as well
  if( !is_callable( array( '\Setka\Editor\Service\ScriptStyles', 'register' ) ) )
      return;
  // Calling for the registration of necessary CSS and JS for the Setka Editor
  // Usually, WP does this when calling for wp_head() (mentioned above)
  \Setka\Editor\Service\ScriptStyles::register();
  \Setka\Editor\Service\ScriptStyles::register_theme_resources();
// Checking if there is a CSS file that we need and displaying its 
  if( isset( $wp_styles->registered['setka-editor-theme-resources'] ) ) {
      $url =& $wp_styles->registered['setka-editor-theme-resources']->src;
      ?><?php
  }
}
setka_editor_print_head_resources(); // Immediately calling for the function

Note 2. A link to CSS is stored in the setka_editor_theme_resource_css option. It can be acquired manually by means of get_option('setka_editor_theme_resource_css').


// Prior to the call, it is recommended to check if the class for prevention of fatal errors in PHP exists
$css = new Setka\Editor\Admin\Options\ThemeResourceCSS\Option();
// Returns only one type of data (if there is no link, then an empty line will be returned)
$url = $css->getValue();
// or (false can be returned if there is no value)
$url = $css->getValueRaw();


 

There is no Setka Editor tab when adding a new post

First, make sure that:

  • Setka Editor plugin is installed and activated (Plugins > Installed plugins).
  • Setka Editor is enabled for Posts (Setka Editor > Settings):

 

Screen_Shot_2017-09-15_at_15.53.32.png

  • The license key is set (Setka Editor > Account > License key):

Screen_Shot_2017-09-18_at_14.52.36.png

 

If you still see:

Screen_Shot_2017-09-15_at_15.43.35.png

instead of

Screen_Shot_2017-09-15_at_15.44.18.png

 

Please, take a screenshot of a browser console in Developer mode (ctrl + shift + i) and send it to us.