10% polylang-theme-strings

Code Review | Polylang Theme Strings

WordPress plugin Polylang Theme Strings scored10%from 54 tests.

About plugin

  • Plugin page: polylang-theme-st...
  • Plugin version: 4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.8
  • WordPress version: 6.3.1
  • First release: May 29, 2015
  • Latest release: Aug 15, 2018
  • Number of updates: 27
  • Update frequency: every 43.5 days
  • Top authors: modeewine (100%)

Code review

54 tests

User reviews

37 reviews

Install metrics

9,000+ active /97,844 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)

Server metrics [RAM: ▼1.75MB] [CPU: ▼56.37ms] Passed 4 tests

This is a short check of server-side resources used by Polylang Theme Strings
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.23 ▼1.235.14 ▼42.04
Dashboard /wp-admin2.25 ▼1.056.84 ▼49.85
Posts /wp-admin/edit.php2.25 ▼1.108.58 ▼40.95
Add New Post /wp-admin/post-new.php2.25 ▼3.637.99 ▼92.65
Media Library /wp-admin/upload.php2.25 ▼0.986.89 ▼27.99
Polylang Theme Strings /wp-admin/admin.php?page=mw_polylang_strings_settings2.256.04

Server storage [IO: ▲0.05MB] [DB: ▲0.00MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 13 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
mw_polylang_strings_settings_search_plugins_strings
mw_polylang_strings_settings_search_native_wp_functions
widget_theysaidso_widget
mw_polylang_strings_theme_twentytwentyone_data
theysaidso_admin_options
mw_polylang_strings_theme_twentytwentytwo_data
mw_polylang_strings_theme_twentynineteen_data
...

Browser metrics Passed 4 tests

An overview of browser requirements for Polylang Theme Strings
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲7113.18 ▼1.211.71 ▼0.0442.94 ▼4.84
Dashboard /wp-admin2,217 ▲325.77 ▼0.1199.84 ▼4.8838.77 ▼2.71
Posts /wp-admin/edit.php2,109 ▲172.03 ▲0.0240.02 ▼1.0133.41 ▼2.70
Add New Post /wp-admin/post-new.php1,550 ▲3623.14 ▲5.53652.69 ▲39.9554.33 ▼4.09
Media Library /wp-admin/upload.php1,402 ▲144.21 ▲0.02101.04 ▼3.8547.50 ▲4.79
Polylang Theme Strings /wp-admin/admin.php?page=mw_polylang_strings_settings8312.0628.0226.38

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
  • This plugin did not uninstall successfully, leaving 13 options in the database
    • mw_polylang_strings_settings_search_native_wp_functions
    • mw_polylang_strings_theme_twentytwentyone_data
    • db_upgraded
    • mw_polylang_strings_theme_twentytwentytwo_data
    • widget_recent-comments
    • widget_recent-posts
    • mw_polylang_strings_theme_twentytwentythree_data
    • mw_polylang_strings_theme_twentynineteen_data
    • mw_polylang_strings_theme_twentytwenty_data
    • mw_polylang_strings_settings_search_plugins_strings
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=mw_polylang_strings_settings
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/polylang-theme-strings/templates/admin-page-settings.php:2
    • > PHP Notice
      Undefined index: _action in wp-content/plugins/polylang-theme-strings/actions.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_template_directory() in wp-content/plugins/polylang-theme-strings/mw-polylang-theme-strings.php:74

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention: You can look at the official readme.txt

polylang-theme-strings/mw-polylang-theme-strings.php 92% from 13 tests

"Polylang Theme Strings" version 4.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("polylang-theme-strings.php" instead of "mw-polylang-theme-strings.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin591 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP47211468
CSS111063
JavaScript114060

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity85.00
▷ Minimum class complexity85.00
▷ Maximum class complexity85.00
Average method complexity3.90
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods2586.21%
▷ Protected methods00.00%
▷ Private methods413.79%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/icon-128x128.png11.69KB4.59KB▼ 60.71%