74% post-lockdown

Code Review | Post Lockdown

WordPress plugin Post Lockdown scored74%from 54 tests.

About plugin

  • Plugin page: post-lockdown
  • Plugin version: 3.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.3
  • WordPress version: 6.3.1
  • First release: May 19, 2015
  • Latest release: Aug 24, 2023
  • Number of updates: 51
  • Update frequency: every 59.2 days
  • Top authors: andyexeter (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active /13,859 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼6.07ms] Passed 4 tests

Server-side resources used by Post Lockdown
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.95 ▼8.71
Dashboard /wp-admin3.46 ▲0.1546.78 ▼6.25
Posts /wp-admin/edit.php3.57 ▲0.2248.84 ▲3.68
Add New Post /wp-admin/post-new.php6.04 ▲0.1580.38 ▼12.98
Media Library /wp-admin/upload.php3.38 ▲0.1537.45 ▲4.72
Post Lockdown /wp-admin/options-general.php?page=postlockdown3.3632.46

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Post Lockdown: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.44 ▼0.311.62 ▼0.4943.24 ▲1.66
Dashboard /wp-admin2,210 ▲225.90 ▲0.09108.47 ▲0.3439.66 ▼1.58
Posts /wp-admin/edit.php2,105 ▲192.02 ▼0.0339.50 ▲3.5334.84 ▲3.07
Add New Post /wp-admin/post-new.php1,536 ▲1623.23 ▼0.19659.64 ▲54.4551.72 ▼2.49
Media Library /wp-admin/upload.php1,395 ▲44.22 ▲0.0397.06 ▲1.3042.09 ▼1.60
Post Lockdown /wp-admin/options-general.php?page=postlockdown9962.4341.5527.62

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'PostLockdown' not found
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/post-lockdown/view/options-page.php:2
    • > PHP Notice
      Undefined variable: notices in wp-content/plugins/post-lockdown/view/admin-notices.php on line 1
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/post-lockdown/view/admin-notices.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/post-lockdown/post-lockdown.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: delete, capabilities, posts, trash, protect...

post-lockdown/post-lockdown.php 92% from 13 tests

Analyzing the main PHP file in "Post Lockdown" version 3.0.6
You should first fix the following items:
  • Text Domain: The text domain should only use lowercase characters and dashes

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
Good job! No executable or dangerous file extensions detected931 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP9171389664
JavaScript23441177
CSS217090

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity13.17
▷ Minimum class complexity3.00
▷ Maximum class complexity35.00
Average method complexity2.39
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods52
▷ Static methods11.92%
▷ Public methods4892.31%
▷ Protected methods00.00%
▷ Private methods47.69%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants5
▷ Global constants00.00%
▷ Class constants5100.00%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 compressed PNG files occupy 0.05MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png24.41KB24.86KB0.00%
assets/banner-1544x500.png7.97KB8.37KB0.00%
assets/icon-256x256.png1.36KB1.48KB0.00%
assets/screenshot-1.png14.87KB15.09KB0.00%
assets/screenshot-2.png4.59KB4.50KB▼ 2.08%