84% add-locale-class

Code Review | Add Locale Class

WordPress plugin Add Locale Class scored84%from 54 tests.

About plugin

  • Plugin page: add-locale-class
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-6.4
  • WordPress version: 6.3.1
  • First release: Aug 14, 2017
  • Latest release: Nov 7, 2023
  • Number of updates: 16
  • Update frequency: every 142.3 days
  • Top authors: AlanP57 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,098 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
Install script ran successfully

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

Analyzing server-side resources used by Add Locale Class
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.35 ▼7.01
Dashboard /wp-admin3.31 ▲0.0150.83 ▲3.02
Posts /wp-admin/edit.php3.36 ▲0.0148.29 ▼0.80
Add New Post /wp-admin/post-new.php5.89 ▲0.0198.89 ▼9.03
Media Library /wp-admin/upload.php3.23 ▲0.0135.25 ▲2.17

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Add Locale Class
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.18 ▼0.141.81 ▲0.2442.65 ▼0.47
Dashboard /wp-admin2,198 ▲185.59 ▼0.1091.91 ▲0.4241.17 ▼0.03
Posts /wp-admin/edit.php2,100 ▼01.94 ▼0.1338.77 ▼1.5935.54 ▼1.82
Add New Post /wp-admin/post-new.php1,526 ▼022.88 ▼0.64595.66 ▼28.9657.90 ▲7.56
Media Library /wp-admin/upload.php1,397 ▼34.19 ▼0.0596.42 ▲1.2241.22 ▲0.75

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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: 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 trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/add-locale-class/add-locale-class.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: render css acording to language setting, css language class, language class

add-locale-class/add-locale-class.php Passed 13 tests

Analyzing the main PHP file in "Add Locale Class" version 1.0.5
108 characters long description:
Adds the current language locale as a class to the body tag in both the front and backend pages of the site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected28 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP19828

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin