84% secret-content

Code Review | Secret Content

WordPress plugin Secret Content scored84%from 54 tests.

About plugin

  • Plugin page: secret-content
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.3
  • WordPress version: 6.3.1
  • First release: Mar 1, 2012
  • Latest release: Mar 1, 2012
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: maxemil (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /5,075 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.67MB] [CPU: ▼14.49ms] Passed 4 tests

This is a short check of server-side resources used by Secret Content
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.55 ▼2.47
Dashboard /wp-admin3.33 ▲0.0344.95 ▼1.39
Posts /wp-admin/edit.php3.38 ▲0.0346.99 ▼1.28
Add New Post /wp-admin/post-new.php3.12 ▼2.7736.66 ▼52.81
Media Library /wp-admin/upload.php3.26 ▲0.0337.09 ▲1.69

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Secret Content
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4314.78 ▲0.041.89 ▼0.2143.04 ▼4.09
Dashboard /wp-admin2,206 ▲215.91 ▲1.03100.84 ▲1.7540.71 ▼4.36
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0337.60 ▼1.3134.43 ▲3.02
Add New Post /wp-admin/post-new.php6,292 ▲4,77219.26 ▼3.90944.26 ▲290.5852.74 ▼0.57
Media Library /wp-admin/upload.php1,391 ▼04.20 ▼0.0096.13 ▼4.6546.39 ▲3.24

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to a member function query() on null in wp-content/plugins/secret-content/uninstall.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/secret-content/secret-content.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: Add an image for screenshot #1 (When you edit a post or page, simply use the checkbox "Show this to logged in visitors only")
The official readme.txt might help

secret-content/secret-content.php Passed 13 tests

The main PHP script in "Secret Content" version 1.0 is automatically included on every request by WordPress
92 characters long description:
Adds metabox to posts/pages - Tick the checkbox to hide content from non logged in visitors.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected205 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP24954180
PO File15625

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.41
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.04MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png36.76KB35.98KB▼ 2.11%