88% content-hider

Code Review | Content Hider

WordPress plugin Content Hider scored 88% from 54 tests.

About plugin

  • Plugin page: content-hider
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5-3.8
  • WordPress version: 5.8.1
  • First release: Jan 18, 2014
  • Latest release: Jan 18, 2014
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: khaxan (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

50+ active / 2,287 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

This is a short check of server-side resources used by Content Hider
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0124.94 ▲2.27
Dashboard /wp-admin3.07 ▲0.0131.04 ▼7.11
Posts /wp-admin/edit.php3.13 ▲0.0229.87 ▼2.59
Add New Post /wp-admin/post-new.php5.44 ▼0.0067.88 ▼717.75
Media Library /wp-admin/upload.php3.02 ▲0.0223.91 ▲0.88
Content Hider Settings /wp-admin/plugins.php?page=wpch_settings2.9719.11

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Content Hider: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,674 ▲7316.00 ▼0.014.76 ▼0.1374.81 ▼4.58
Dashboard /wp-admin2,935 ▲366.10 ▼0.05110.72 ▼27.43166.43 ▼7.96
Posts /wp-admin/edit.php2,745 ▲53.24 ▼0.0062.85 ▲1.43136.22 ▼1.56
Add New Post /wp-admin/post-new.php3,701 ▼11418.83 ▼0.76429.27 ▼66.77175.95 ▲9.29
Media Library /wp-admin/upload.php1,757 ▲55.49 ▼0.07141.11 ▲0.16184.79 ▼0.25
Content Hider Settings /wp-admin/plugins.php?page=wpch_settings1,2603.2262.60140.07

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

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
Please fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=wpch_settings
    • > Notice in wp-content/plugins/content-hider/options-panel.php+131
    Trying to access array offset on value of type bool

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
The following issues need your attention
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/content-hider/short-codes.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/content-hider/content-hider.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/content-hider/options-panel.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/content-hider/editor-buttons.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% from 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
9 plugin tags: private content, members-only, sensitive content, membership website, hide posts...

content-hider/content-hider.php 92% from 13 tests

The principal PHP file in "Content Hider" v. 0.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 147 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin266 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP43026178
CSS112066
JavaScript20222

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
static/img/error.png0.22KB0.24KB0.00%
static/js/lock.png0.21KB0.25KB0.00%