94% add-locale-class

Code Review | Add Locale Class

WordPress plugin Add Locale Class scored 94% from 54 tests.

About plugin

  • Plugin page: add-locale-class
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-5.5
  • WordPress version: 5.9.2
  • First release: Aug 14, 2017
  • Latest release: Aug 7, 2020
  • Number of updates: 10
  • Update frequency: every 109.0 days
  • Top authors: AlanP57 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 752 total downloads

Benchmarks

Plugin footprint Passed 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.01MB] [CPU: ▼294.46ms] Passed 4 tests

A check of server-side resources used by Add Locale Class
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0254.47 ▲4.86
Dashboard /wp-admin3.42 ▲0.0132.17 ▼3.96
Posts /wp-admin/edit.php3.65 ▲0.0136.44 ▼4.08
Add New Post /wp-admin/post-new.php6.89 ▼0.0893.37 ▼1,173.24
Media Library /wp-admin/upload.php3.30 ▲0.0126.01 ▲3.46

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Add Locale Class
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,795 ▲7315.82 ▲0.286.63 ▲0.572.72 ▲0.39
Dashboard /wp-admin2,892 ▲416.07 ▼0.06116.90 ▼25.47156.51 ▼7.44
Posts /wp-admin/edit.php2,694 ▼03.24 ▲0.0160.90 ▼2.56135.47 ▼7.25
Add New Post /wp-admin/post-new.php1,668 ▲1118.80 ▲3.23414.01 ▲1.15164.79 ▲10.52
Media Library /wp-admin/upload.php1,698 ▲65.48 ▼0.05137.05 ▼6.67188.01 ▲7.16

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > 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 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: language class, render css acording to language setting, css language class

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

The main PHP script in "Add Locale Class" version 1.0.2 is automatically included on every request by WordPress
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 glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin28 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP19828

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 issues
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin