83% switch-polylang-to-ukrainian-language

Code Review | Switch Polylang To Ukrainian language

WordPress plugin Switch Polylang To Ukrainian language scored83%from 54 tests.

About plugin

  • Plugin page: switch-polylang-t...
  • Plugin version: 0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Aug 1, 2022
  • Latest release: Nov 30, 2023
  • Number of updates: 6
  • Update frequency: every 81.7 days
  • Top authors: svoy_man (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /239 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.62ms] Passed 4 tests

Server-side resources used by Switch Polylang To Ukrainian language
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.74 ▼0.93
Dashboard /wp-admin3.31 ▲0.0150.53 ▲2.48
Posts /wp-admin/edit.php3.36 ▲0.0147.65 ▼1.18
Add New Post /wp-admin/post-new.php5.89 ▲0.0189.37 ▼3.37
Media Library /wp-admin/upload.php3.24 ▲0.0134.79 ▼1.00

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Switch Polylang To Ukrainian language: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3414.37 ▲0.051.60 ▼0.1136.61 ▼1.61
Dashboard /wp-admin2,201 ▲215.62 ▼0.0296.91 ▼4.1444.14 ▼0.22
Posts /wp-admin/edit.php2,109 ▲62.15 ▲0.1839.67 ▼3.0337.86 ▲1.06
Add New Post /wp-admin/post-new.php1,532 ▲623.83 ▲0.32672.40 ▲73.0553.67 ▼2.62
Media Library /wp-admin/upload.php1,403 ▲94.17 ▼0.0196.52 ▼0.0142.50 ▼1.11

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 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/switch-polylang-to-ukrainian-language/templates/popup.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/switch-polylang-to-ukrainian-language/templates/admin-notices.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/switch-polylang-to-ukrainian-language/plugin.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • License uri: Invalid URI ("https: //www.gnu.org/licenses/gpl-2.0.html")
You can look at the official readme.txt

switch-polylang-to-ukrainian-language/plugin.php 85% from 13 tests

The main PHP file in "Switch Polylang To Ukrainian language" ver. 0.2 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("switch-polylang-to-ukrainian-language.php" instead of "plugin.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 plugin153 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP331355
CSS18054
JavaScript15044

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png72.46KB34.41KB▼ 52.52%