84% dc-hide-publish-button

Code Review | DC Hide Publish Button

WordPress plugin DC Hide Publish Button scored84%from 54 tests.

About plugin

  • Plugin page: dc-hide-publish-b...
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.7
  • WordPress version: 6.3.1
  • First release: Mar 22, 2017
  • Latest release: Mar 25, 2017
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: donixe (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /779 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.74ms] Passed 4 tests

This is a short check of server-side resources used by DC Hide Publish Button
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0345.81 ▲2.10
Dashboard /wp-admin3.35 ▲0.0548.32 ▼4.31
Posts /wp-admin/edit.php3.46 ▲0.1150.78 ▼3.47
Add New Post /wp-admin/post-new.php5.93 ▲0.0489.47 ▼7.44
Media Library /wp-admin/upload.php3.27 ▲0.0438.99 ▲0.26
DC Hide Publish Button /wp-admin/options-general.php?page=dc-hide-publish-button3.2143.51

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for DC Hide Publish Button
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲6113.31 ▼0.984.52 ▲2.6043.96 ▼0.85
Dashboard /wp-admin2,213 ▲255.86 ▲0.99104.31 ▼15.3439.16 ▼3.80
Posts /wp-admin/edit.php2,096 ▲72.04 ▲0.0337.95 ▼2.2135.57 ▲1.02
Add New Post /wp-admin/post-new.php1,540 ▲2123.07 ▼0.18628.11 ▼22.3356.20 ▼22.69
Media Library /wp-admin/upload.php1,395 ▲104.24 ▲0.0495.36 ▼11.2842.67 ▼3.06
DC Hide Publish Button /wp-admin/options-general.php?page=dc-hide-publish-button8432.2024.5529.73

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=dc-hide-publish-button
    • > Notice in wp-content/plugins/dc-hide-publish-button/class.php+150
    Undefined variable: checked

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed: Please take inspiration from this readme.txt

dc-hide-publish-button/dc-hide-publish-button.php Passed 13 tests

This is the main PHP file of "DC Hide Publish Button" version 2.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
36 characters long description:
Avoid accidentally publish post/page

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin200 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP24515200

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.32
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods1178.57%
▷ Protected methods00.00%
▷ Private methods321.43%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin