79% sublanguage

Code Review | Sublanguage

WordPress plugin Sublanguage scored79%from 54 tests.

About plugin

  • Plugin page: sublanguage
  • Plugin version: 2.10
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.2
  • WordPress version: 6.3.1
  • First release: Jul 3, 2015
  • Latest release: Jul 9, 2023
  • Number of updates: 137
  • Update frequency: every 21.5 days
  • Top authors: maximeschoeni (100%)

Code review

54 tests

User reviews

30 reviews

Install metrics

1,000+ active /23,270 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.89MB] [CPU: ▲1.35ms] Passed 4 tests

Analyzing server-side resources used by Sublanguage
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.19 ▲0.7351.43 ▲4.25
Dashboard /wp-admin4.23 ▲0.9359.01 ▲3.52
Posts /wp-admin/edit.php4.35 ▲1.0057.68 ▲5.86
Add New Post /wp-admin/post-new.php6.86 ▲0.9793.23 ▼8.25
Media Library /wp-admin/upload.php4.14 ▲0.9249.88 ▲12.74
Language Options /wp-admin/edit.php?page=post_language_option4.1539.45
Language Options /wp-admin/edit.php?post_type=page&page=page_language_option4.1538.09
Add language /wp-admin/post-new.php?post_type=language4.6060.16
Taxonomy Language Options /wp-admin/admin.php?page=category_language_option4.1648.17
Sublanguage /wp-admin/options-general.php?page=sublanguage-settings4.1639.17
Languages /wp-admin/edit.php?post_type=language4.2446.38

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 39 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
widget_sublanguage_widget
widget_recent-comments
sublanguage
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Sublanguage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲7814.27 ▼0.081.89 ▼0.2943.89 ▲0.98
Dashboard /wp-admin2,239 ▲625.54 ▼0.1296.83 ▲0.7545.35 ▲2.19
Posts /wp-admin/edit.php2,151 ▲511.99 ▲0.0134.80 ▼2.7837.51 ▲1.41
Add New Post /wp-admin/post-new.php1,579 ▲5323.28 ▲0.18716.05 ▲43.4338.39 ▼7.66
Media Library /wp-admin/upload.php1,444 ▲474.24 ▲0.05115.50 ▲0.3247.51 ▼3.52
Language Options /wp-admin/edit.php?page=post_language_option9012.0125.1527.71
Language Options /wp-admin/edit.php?post_type=page&page=page_language_option9012.0427.8129.51
Add language /wp-admin/post-new.php?post_type=language2,1392.3554.21122.15
Taxonomy Language Options /wp-admin/admin.php?page=category_language_option7992.0025.6823.20
Sublanguage /wp-admin/options-general.php?page=sublanguage-settings1,1432.0022.7730.02
Languages /wp-admin/edit.php?post_type=language1,6491.9840.9033.21

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 8 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • sublanguage
    • widget_sublanguage_widget
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/sublanguage/include/editor-button-script.php
  • 25× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post() in wp-content/plugins/sublanguage/include/extra-post-metabox.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Sublanguage_admin' not found in wp-content/plugins/sublanguage/class-admin-ui.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/sublanguage/include/settings-page.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sublanguage/widget.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/sublanguage/sublanguage.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/sublanguage/include/settings-post-option-page.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/sublanguage/include/nav-menu-item-metabox.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Sublanguage_rewrite' not found in wp-content/plugins/sublanguage/class-admin.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/sublanguage/include/posts-form-language-tabs.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/sublanguage/include/language-settings-metabox.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: multilanguage, translation, multilingual, language

sublanguage/sublanguage.php Passed 13 tests

The primary PHP file in "Sublanguage" version 2.10 is used by WordPress to initiate all plugin functionality
50 characters long description:
Plugin for building a site with multiple languages

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected5,352 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP263,0532,7044,309
PO File3148158430
JavaScript34011282
Markdown11310265
CSS20166

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity98.89
▷ Minimum class complexity4.00
▷ Maximum class complexity196.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity49.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods292
▷ Static methods20.68%
▷ Public methods28396.92%
▷ Protected methods00.00%
▷ Private methods93.08%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.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
There were not PNG files found in your plugin