84% preview-blog-draft

Code Review | Preview Blog Draft

WordPress plugin Preview Blog Draft scored84%from 54 tests.

About plugin

  • Plugin page: preview-blog-draft
  • Plugin version: 1.3.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.8
  • WordPress version: 6.3.1
  • First release: Jan 20, 2014
  • Latest release: Mar 10, 2014
  • Number of updates: 39
  • Update frequency: every 1.3 days
  • Top authors: eflyjason (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

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

Server metrics [RAM: ▲0.03MB] [CPU: ▼1.24ms] Passed 4 tests

Analyzing server-side resources used by Preview Blog Draft
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0242.81 ▼1.44
Dashboard /wp-admin3.34 ▲0.0349.80 ▲3.74
Posts /wp-admin/edit.php3.39 ▲0.0345.73 ▼1.46
Add New Post /wp-admin/post-new.php5.92 ▲0.0383.30 ▼3.11
Media Library /wp-admin/upload.php3.26 ▲0.0337.39 ▲1.06
Preview Blog Draft /wp-admin/options-general.php?page=preview-blog-draft-options3.2336.50

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
preview_blog_draft_post_status
preview_blog_draft_name
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Preview Blog Draft
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.48 ▼0.171.77 ▼0.0642.51 ▼6.11
Dashboard /wp-admin2,207 ▲194.87 ▼0.01106.82 ▲0.9942.12 ▼0.92
Posts /wp-admin/edit.php2,093 ▲72.04 ▲0.0332.93 ▼7.2536.18 ▼1.47
Add New Post /wp-admin/post-new.php1,537 ▲423.20 ▼0.11678.26 ▼29.9956.99 ▲3.54
Media Library /wp-admin/upload.php1,395 ▲74.22 ▼0.00100.33 ▼9.7445.69 ▼1.95
Preview Blog Draft /wp-admin/options-general.php?page=preview-blog-draft-options8272.0624.7929.22

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 8 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • preview_blog_draft_post_status
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • preview_blog_draft_name

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)
Good news, no errors were detected

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 items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/preview-blog-draft/options.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/preview-blog-draft/preview-blog-draft.php:34

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 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
3 plugin tags: post, draft, preview

preview-blog-draft/preview-blog-draft.php Passed 13 tests

The primary PHP file in "Preview Blog Draft" version 1.3.6 is used by WordPress to initiate all plugin functionality
79 characters long description:
Let visitors can see the title of your draft post and content of "Coming Soon!"

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin181 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2182597
PO File2242484

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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