84% secret-posts

Code Review | Secret Posts

WordPress plugin Secret Posts scored84%from 54 tests.

About plugin

  • Plugin page: secret-posts
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.2.2
  • WordPress version: 6.3.1
  • First release: Jul 21, 2015
  • Latest release: Jul 21, 2015
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: sgrant (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /855 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 successfully, without throwing any errors or notices

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

A check of server-side resources used by Secret Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.53 ▼4.53
Dashboard /wp-admin3.33 ▼0.0244.85 ▼13.42
Posts /wp-admin/edit.php3.38 ▲0.0245.41 ▲1.11
Add New Post /wp-admin/post-new.php5.91 ▲0.0283.75 ▼13.39
Media Library /wp-admin/upload.php3.25 ▲0.0138.65 ▲2.91

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Secret Posts
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.24 ▼0.491.86 ▲0.2737.37 ▼3.07
Dashboard /wp-admin2,195 ▲185.53 ▼0.0582.63 ▼4.3736.27 ▼6.00
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0135.13 ▼3.3933.41 ▼1.58
Add New Post /wp-admin/post-new.php6,227 ▲4,70119.00 ▼4.47905.56 ▲243.9258.91 ▲2.30
Media Library /wp-admin/upload.php1,400 ▼04.20 ▲0.02110.21 ▲11.8647.42 ▲1.53

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/secret-posts/secret-posts.php:34

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: hide, private, secret posts, posts

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

The main PHP script in "Secret Posts" version 1.0 is automatically included on every request by WordPress
79 characters long description:
Mark WordPress posts as private after a specified number of page views or time.

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
Everything looks great! No dangerous files found in this plugin75 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1182675

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods116.67%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin