79% forceprivate

Code Review | ForcePrivate

WordPress plugin ForcePrivate scored79%from 54 tests.

About plugin

  • Plugin page: forceprivate
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.6
  • WordPress version: 6.3.1
  • First release: Aug 28, 2013
  • Latest release: Sep 6, 2013
  • Number of updates: 16
  • Update frequency: every 0.6 days
  • Top authors: ellbristow (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,096 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

A check of server-side resources used by ForcePrivate
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.17 ▼3.41
Dashboard /wp-admin3.33 ▼0.0252.41 ▼14.62
Posts /wp-admin/edit.php3.38 ▲0.0256.15 ▲5.71
Add New Post /wp-admin/post-new.php5.91 ▲0.0290.95 ▼18.75
Media Library /wp-admin/upload.php3.25 ▲0.0240.10 ▲2.09
ForcePrivate /wp-admin/options-general.php?page=force_private_options3.1932.33

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for ForcePrivate
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.24 ▼0.391.90 ▼0.1246.79 ▲4.98
Dashboard /wp-admin2,199 ▲195.57 ▼0.0881.57 ▼7.8038.66 ▼7.00
Posts /wp-admin/edit.php2,104 ▲42.04 ▼0.0135.72 ▼0.6432.30 ▼3.12
Add New Post /wp-admin/post-new.php1,529 ▼2017.60 ▼5.29671.50 ▼18.3854.59 ▼1.22
Media Library /wp-admin/upload.php1,404 ▲44.18 ▼0.17105.67 ▼3.9447.50 ▲0.88
ForcePrivate /wp-admin/options-general.php?page=force_private_options8262.0325.3727.34

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
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=force_private_options
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=force_private_options
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
Please fix the following
  • 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/forceprivate/forceprivate.php:29

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 Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: private, force, authors, posts

forceprivate/forceprivate.php Passed 13 tests

The primary PHP file in "ForcePrivate" version 1.1 is used by WordPress to initiate all plugin functionality
68 characters long description:
Force all posts by users without Editor or higher role to be private

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
Good job! No executable or dangerous file extensions detected120 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP34139120

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
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%
Functions6
▷ Named functions6100.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
No PNG images were found in this plugin