78% hide-post-locker

Code Review | Hide Post Locker

WordPress plugin Hide Post Locker scored78%from 54 tests.

About plugin

  • Plugin page: hide-post-locker
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6+
  • WordPress version: 6.3.1
  • First release: Aug 30, 2013
  • Latest release: Aug 30, 2013
  • Number of updates: 3
  • Update frequency: every 3.3 days
  • Top authors: Brainfestation (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /866 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.10MB] [CPU: ▼11.73ms] Passed 4 tests

An overview of server-side resources used by Hide Post Locker
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.34 ▼8.58
Dashboard /wp-admin3.31 ▲0.0143.23 ▼5.96
Posts /wp-admin/edit.php3.38 ▲0.0243.87 ▼6.22
Add New Post /wp-admin/post-new.php5.46 ▼0.4374.94 ▼26.17
Media Library /wp-admin/upload.php3.22 ▼0.0130.85 ▼5.07
Hide Post Locker /wp-admin/options-general.php?page=hpl-options3.1929.51

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Hide Post Locker
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.48 ▲0.221.83 ▲0.0143.02 ▼0.65
Dashboard /wp-admin2,210 ▲224.85 ▼0.11107.91 ▲1.8841.90 ▼2.15
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0240.46 ▼0.4534.32 ▼3.69
Add New Post /wp-admin/post-new.php1,602 ▲6918.29 ▼4.79621.61 ▼40.5942.45 ▼16.19
Media Library /wp-admin/upload.php1,386 ▼24.25 ▲0.0796.75 ▼15.8842.35 ▼6.87
Hide Post Locker /wp-admin/options-general.php?page=hpl-options8762.0624.7229.59

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=hpl-options
    • > Notice in wp-content/plugins/hide-post-locker/hide-post-locker.php+134
    Trying to access array offset on value of type null

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hide-post-locker/hide-post-locker.php:50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hide-post-locker/admin/post-locker-admin-page.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (The post locker screen with the link to hide the window.), #2 (The message bar at the bottom of the window when preview the edit window.), #3 (Custom admin area to change the default text!), #4 (Results of our text entered into the "Message Window" area in the admin options.), #5 (Results of our text entered into the "Preview Message Box" area in the admin options.)
  • Tested up to: Invalid plugin version format
The official readme.txt might help

hide-post-locker/hide-post-locker.php 92% from 13 tests

The principal PHP file in "Hide Post Locker" v. 0.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
No dangerous file extensions were detected246 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP281169176
Markdown116030
CSS12028
JavaScript19812

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity2.86
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.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
5 PNG files occupy 0.15MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png16.82KB4.94KB▼ 70.63%
screenshot-1.png21.35KB6.26KB▼ 70.68%
screenshot-4.png20.56KB5.97KB▼ 70.98%
screenshot-3.png76.36KB26.46KB▼ 65.35%
screenshot-2.png14.57KB3.91KB▼ 73.19%