84% hidden-contents

Code Review | Hidden Contents

WordPress plugin Hidden Contents scored84%from 54 tests.

About plugin

  • Plugin page: hidden-contents
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.1
  • WordPress version: 6.3.1
  • First release: Oct 6, 2018
  • Latest release: Mar 11, 2019
  • Number of updates: 10
  • Update frequency: every 15.6 days
  • Top authors: man4toman (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /789 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 gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼3.95ms] Passed 4 tests

A check of server-side resources used by Hidden Contents
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.46 ▼0.69
Dashboard /wp-admin3.35 ▲0.0543.61 ▼2.85
Posts /wp-admin/edit.php3.40 ▲0.0546.70 ▲1.74
Add New Post /wp-admin/post-new.php5.95 ▲0.0789.68 ▼13.98
Media Library /wp-admin/upload.php3.27 ▲0.0536.11 ▲3.54

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Hidden Contents
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲7613.25 ▼1.501.70 ▲0.0740.89 ▲1.18
Dashboard /wp-admin2,226 ▲345.86 ▲0.9196.79 ▼8.4740.53 ▼6.53
Posts /wp-admin/edit.php2,112 ▲202.06 ▲0.0439.26 ▲4.2934.74 ▲3.66
Add New Post /wp-admin/post-new.php1,540 ▲2618.36 ▲0.90652.66 ▼36.3767.98 ▲13.92
Media Library /wp-admin/upload.php1,405 ▲174.29 ▲0.06108.22 ▲0.1346.24 ▲0.83

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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 fix the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hidden-contents/hidden-contents.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/hidden-contents/languages/common-strings.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Settings page), #2 (Hidden contents output)
You can take inspiration from this readme.txt

hidden-contents/hidden-contents.php Passed 13 tests

This is the main PHP file of "Hidden Contents" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
61 characters long description:
A handy plugin for hide contents and images from guest users.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected374 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP22126207
CSS21074
PO File1283971
JavaScript23122

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
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%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png9.10KB4.18KB▼ 54.03%
screenshot-1.png19.19KB11.38KB▼ 40.66%