84% slaf-polylang

Code Review | Specified language access for Polylang

WordPress plugin Specified language access for Polylang scored84%from 54 tests.

About plugin

  • Plugin page: slaf-polylang
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.7
  • WordPress version: 6.3.1
  • First release: Jul 30, 2018
  • Latest release: Jul 30, 2018
  • Number of updates: 6
  • Update frequency: every 0.3 days
  • Top authors: cmachu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /779 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
This plugin's installer ran successfully

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

An overview of server-side resources used by Specified language access for Polylang
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.00 ▼0.48
Dashboard /wp-admin3.31 ▼0.0443.07 ▼13.30
Posts /wp-admin/edit.php3.36 ▲0.0041.54 ▼3.18
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.42 ▼16.19
Media Library /wp-admin/upload.php3.23 ▲0.0031.58 ▼4.70

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Specified language access for Polylang
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.34 ▼0.011.78 ▲0.1742.17 ▲3.14
Dashboard /wp-admin2,195 ▲215.55 ▲0.0285.49 ▼6.0339.51 ▲0.56
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0334.57 ▼4.4536.66 ▲0.81
Add New Post /wp-admin/post-new.php1,526 ▼023.04 ▼0.44699.43 ▲21.8060.02 ▲6.61
Media Library /wp-admin/upload.php1,403 ▲34.17 ▲0.0698.02 ▼20.0844.20 ▼1.92

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

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
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
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/slaf-polylang/includes/class-slaf-polylang-activator.php on line 23
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/slaf-polylang/includes/class-slaf-polylang-activator.php on line 23
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/slaf-polylang/includes/class-slaf-polylang-activator.php on line 23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed: The official readme.txt is a good inspiration

slaf-polylang/slaf-polylang.php Passed 13 tests

The entry point to "Specified language access for Polylang" version 1.1.2 is a PHP file that has certain tags in its header comment area
95 characters long description:
Plugin allows restrict users to edit content on wp-admin only with specified selected language.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin309 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP10118487292
JavaScript14017

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity3.57
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods27
▷ Static methods27.41%
▷ Public methods2385.19%
▷ Protected methods00.00%
▷ Private methods414.81%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG images were found in this plugin