83% per-post-language

Code Review | Per Post Language

WordPress plugin Per Post Language scored83%from 54 tests.

About plugin

  • Plugin page: per-post-language
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.5.2
  • WordPress version: 6.3.1
  • First release: Apr 12, 2016
  • Latest release: May 10, 2016
  • Number of updates: 9
  • Update frequency: every 3.1 days
  • Top authors: fduraibi (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

500+ active /3,538 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼10.98ms] 75% from 4 tests

This is a short check of server-side resources used by Per Post Language
The following require your attention
  • CPU: Total CPU usage should be kept under 500.00ms (currently 501.98ms on /wp-admin/options-general.php?page=ppl_settings_page)
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.07 ▼4.49
Dashboard /wp-admin3.37 ▲0.0250.25 ▼21.45
Posts /wp-admin/edit.php3.40 ▲0.0448.94 ▼6.52
Add New Post /wp-admin/post-new.php5.95 ▲0.0785.85 ▼11.47
Media Library /wp-admin/upload.php3.29 ▲0.0637.83 ▲1.52
Per Post Language /wp-admin/options-general.php?page=ppl_settings_page3.72501.98

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
ppl_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Per Post Language
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.21 ▼0.171.97 ▲0.2142.13 ▲0.21
Dashboard /wp-admin2,202 ▲255.62 ▼0.0389.70 ▼21.6538.99 ▼5.38
Posts /wp-admin/edit.php2,104 ▲41.97 ▼0.0736.52 ▲0.9834.45 ▲0.89
Add New Post /wp-admin/post-new.php6,222 ▲4,69626.01 ▲2.31921.66 ▲203.6253.79 ▲1.19
Media Library /wp-admin/upload.php1,404 ▲74.21 ▼0.02100.77 ▼8.1842.36 ▼5.60
Per Post Language /wp-admin/options-general.php?page=ppl_settings_page1,3772.0023.7499.38

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • ppl_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/per-post-language/ppl_settings_page.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/per-post-language/ppl_settings_page.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

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:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
You can take inspiration from this readme.txt

per-post-language/ppl_core.php 92% from 13 tests

The primary PHP file in "Per Post Language" version 1.3 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("per-post-language.php" instead of "ppl_core.php")

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
Good job! No executable or dangerous file extensions detected316 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP22954245
PO File1212771

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.39
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%
Functions10
▷ Named functions10100.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
No PNG files were detected