83% polylang-supertext

Code Review | Supertext Translation and Proofreading

WordPress plugin Supertext Translation and Proofreading scored83%from 54 tests.

About plugin

  • Plugin page: polylang-supertext
  • Plugin version: 4.22
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: Aug 19, 2015
  • Latest release: Nov 30, 2023
  • Number of updates: 137
  • Update frequency: every 22.2 days
  • Top authors: Supertext (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active /6,706 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.18MB] [CPU: ▼2.10ms] Passed 4 tests

Analyzing server-side resources used by Supertext Translation and Proofreading
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.41 ▲1.16
Dashboard /wp-admin3.54 ▲0.2347.26 ▼1.38
Posts /wp-admin/edit.php3.71 ▲0.3552.38 ▲1.72
Add New Post /wp-admin/post-new.php6.12 ▲0.2388.35 ▼6.04
Media Library /wp-admin/upload.php3.47 ▲0.2437.71 ▼2.15
Supertext /wp-admin/options-general.php?page=supertext-settings3.4935.24

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 138 new files
Database: no new tables, 9 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
polylang_supertext_version
widget_theysaidso_widget
widget_recent-comments
polylang_supertext_settings
can_compress_scripts
polylang_supertext_environment_adjusted

Browser metrics Passed 4 tests

This is an overview of browser requirements for Supertext Translation and Proofreading
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲4714.67 ▲0.391.60 ▼0.0636.02 ▼0.01
Dashboard /wp-admin2,199 ▲185.61 ▼0.1093.41 ▼16.2941.51 ▼0.68
Posts /wp-admin/edit.php2,178 ▲782.24 ▲0.3040.17 ▼0.7036.49 ▼1.40
Add New Post /wp-admin/post-new.php1,529 ▲323.31 ▲0.29638.17 ▼30.7255.24 ▲0.16
Media Library /wp-admin/upload.php1,457 ▲574.26 ▲0.0999.24 ▼15.8042.22 ▼8.01
Supertext /wp-admin/options-general.php?page=supertext-settings1,1462.3440.2629.97

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 8 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • polylang_supertext_environment_adjusted
    • polylang_supertext_version
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 45× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Supertext\\TextAccessors\\PostTextAccessor' not found in wp-content/plugins/polylang-supertext/src/Supertext/TextAccessors/DiviBuilderTextAccessor.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Supertext\\TextAccessors\\PostTextAccessor' not found in wp-content/plugins/polylang-supertext/src/Supertext/TextAccessors/VisualComposerTextAccessor.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/polylang-supertext/views/backend/settings-elementor.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Supertext\\TextAccessors\\ITextAccessor' not found in wp-content/plugins/polylang-supertext/src/Supertext/TextAccessors/CustomFieldsTextAccessor.php:14
    • > PHP Fatal error
      Uncaught Error: Call to a member function getSettingOption() on null in wp-content/plugins/polylang-supertext/views/backend/settings-languages.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Supertext\\Api\\IMultilang' not found in wp-content/plugins/polylang-supertext/src/Supertext/Api/PolylangApiWrapper.php:9
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/polylang-supertext/views/backend/settings-custom-fields.php on line 13
    • > PHP Notice
      Undefined variable: library in wp-content/plugins/polylang-supertext/views/backend/settings-users.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to a member function getSettingOption() on null in wp-content/plugins/polylang-supertext/views/backend/settings-users.php:5
    • > PHP Notice
      Undefined variable: library in wp-content/plugins/polylang-supertext/views/backend/settings-api.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/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 an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes: The official readme.txt is a good inspiration

polylang-supertext/plugin.php 85% from 13 tests

The primary PHP file in "Supertext Translation and Proofreading" version 4.22 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("polylang-supertext.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin21,003 lines of code in 99 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript94182,5767,296
PO File182,4002,6595,298
PHP601,1931,7395,081
CSS872562,674
Sass2901562
Markdown128061
JSON10031

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity12.30
▷ Minimum class complexity1.00
▷ Maximum class complexity59.00
Average method complexity2.52
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces7
Interfaces6
Traits0
Classes41
▷ Abstract classes37.32%
▷ Concrete classes3892.68%
▷ Final classes00.00%
Methods372
▷ Static methods184.84%
▷ Public methods26671.51%
▷ Protected methods71.88%
▷ Private methods9926.61%
Functions6
▷ Named functions350.00%
▷ Anonymous functions350.00%
Constants67
▷ Global constants57.46%
▷ Class constants6292.54%
▷ Public constants62100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/images/delete.png0.82KB0.86KB0.00%
resources/scripts/jstree/themes/default/40px.png1.84KB1.84KB0.00%
resources/images/logo_supertext.png0.62KB0.44KB▼ 27.78%
resources/images/arrow-right.png1.27KB0.25KB▼ 80.43%
resources/images/icon-st.png0.86KB0.69KB▼ 20.23%