78% lh-restricted-post-status

Code Review | LH Restricted Post Status

WordPress plugin LH Restricted Post Status scored78%from 54 tests.

About plugin

  • Plugin page: lh-restricted-pos...
  • Plugin version: 1.03
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.9
  • WordPress version: 6.3.1
  • First release: Jan 23, 2017
  • Latest release: Dec 18, 2017
  • Number of updates: 6
  • Update frequency: every 336.3 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /578 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.17MB] [CPU: ▼1.97ms] Passed 4 tests

This is a short check of server-side resources used by LH Restricted Post Status
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1242.85 ▼1.75
Dashboard /wp-admin3.49 ▲0.1951.25 ▼0.88
Posts /wp-admin/edit.php3.60 ▲0.2548.92 ▼3.11
Add New Post /wp-admin/post-new.php6.09 ▲0.20100.11 ▼2.14
Media Library /wp-admin/upload.php3.41 ▲0.1839.26 ▲4.01
Restricted Post Status /wp-admin/options-general.php?page=lh-restricted-post-status/lh-restricted-post-status.php3.3735.82

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

LH Restricted Post Status: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5814.64 ▲0.261.64 ▼0.2442.94 ▲1.15
Dashboard /wp-admin2,219 ▲124.85 ▼0.13102.00 ▼19.0240.37 ▼5.40
Posts /wp-admin/edit.php2,142 ▲422.08 ▲0.0438.41 ▲3.0835.21 ▼0.63
Add New Post /wp-admin/post-new.php6,561 ▲5,02726.15 ▲2.85957.19 ▲308.6041.03 ▼14.74
Media Library /wp-admin/upload.php1,404 ▲44.21 ▼0.0396.82 ▼9.9742.88 ▼4.51
Restricted Post Status /wp-admin/options-general.php?page=lh-restricted-post-status/lh-restricted-post-status.php8102.1524.2028.83

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=lh-restricted-post-status/lh-restricted-post-status.php
    • > Notice in wp-content/plugins/lh-restricted-post-status/partials/option-settings.php+31
    Trying to access array offset on value of type bool
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=lh-restricted-post-status/lh-restricted-post-status.php
    • > Warning in wp-content/plugins/lh-restricted-post-status/partials/option-settings.php+31
    in_array() expects parameter 2 to be array, null given

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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/lh-restricted-post-status/partials/option-settings.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 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
7 plugin tags: admin, workflow, restricted, pages, posts...

lh-restricted-post-status/lh-restricted-post-status.php 85% from 13 tests

The main PHP script in "LH Restricted Post Status" version 1.03 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Domain Path: The domain path folder was not found ("/languages/")
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin1,977 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP7346624918
PO File5320409753
JavaScript69245306

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity26.00
▷ Minimum class complexity7.00
▷ Maximum class complexity77.00
Average method complexity4.23
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods31
▷ Static methods26.45%
▷ Public methods2477.42%
▷ Protected methods00.00%
▷ Private methods722.58%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin