78% drafts-of-post-revisions

Code Review | Drafts of Post Revisions

WordPress plugin Drafts of Post Revisions scored 78% from 54 tests.

About plugin

  • Plugin page: drafts-of-post-re...
  • Plugin version: 0.8.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.4.2
  • WordPress version: 6.3.1
  • First release: Oct 19, 2012
  • Latest release: Dec 21, 2013
  • Number of updates: 9
  • Update frequency: every 47.6 days
  • Top authors: daxitude (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

100+ active / 3,996 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.07MB] [CPU: ▼12.76ms] Passed 4 tests

Analyzing server-side resources used by Drafts of Post Revisions
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0739.41 ▼0.86
Dashboard /wp-admin3.29 ▼0.0132.33 ▼18.74
Posts /wp-admin/edit.php3.36 ▲0.0035.08 ▼10.25
Add New Post /wp-admin/post-new.php5.53 ▼0.3574.34 ▼17.43
Media Library /wp-admin/upload.php3.30 ▲0.0730.34 ▼4.63
Drafts of Revisions /wp-admin/options-general.php?page=dpr_options3.2727.97

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 37 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
dpr_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Drafts of Post Revisions
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.19 ▼0.951.75 ▼0.0447.42 ▲2.60
Dashboard /wp-admin2,210 ▲225.88 ▲1.0096.65 ▼22.5442.13 ▼5.30
Posts /wp-admin/edit.php2,095 ▲62.06 ▲0.0534.96 ▼3.4134.13 ▼0.10
Add New Post /wp-admin/post-new.php1,536 ▲2223.11 ▲5.47640.40 ▼45.5965.36 ▲5.56
Media Library /wp-admin/upload.php1,392 ▲14.20 ▼0.0698.66 ▼2.8941.78 ▼4.61
Drafts of Revisions /wp-admin/options-general.php?page=dpr_options8412.0624.0928.03

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=dpr_options
    • > Deprecated in wp-content/plugins/drafts-of-post-revisions/core.php+268
    Function create_function() is deprecated

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Loader' not found in wp-content/plugins/drafts-of-post-revisions/Mustache/Loader/ArrayLoader.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/drafts-of-post-revisions/draft-revisions.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Loader' not found in wp-content/plugins/drafts-of-post-revisions/Mustache/Loader/StringLoader.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Loader' not found in wp-content/plugins/drafts-of-post-revisions/Mustache/Loader/FilesystemLoader.php:29

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (Draft revisions organized in edit.php under their own custom post status)
The official readme.txt is a good inspiration

drafts-of-post-revisions/draft-revisions.php 92% from 13 tests

"Drafts of Post Revisions" version 0.8.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("drafts-of-post-revisions.php" instead of "draft-revisions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin1,717 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP213961,2071,568
HTML820084
Markdown119044
JavaScript112321

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity10.89
▷ Minimum class complexity1.00
▷ Maximum class complexity43.00
Average method complexity2.28
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces2
Traits0
Classes17
▷ Abstract classes211.76%
▷ Concrete classes1588.24%
▷ Final classes00.00%
Methods151
▷ Static methods138.61%
▷ Public methods11676.82%
▷ Protected methods42.65%
▷ Private methods3120.53%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants36
▷ Global constants00.00%
▷ Class constants36100.00%
▷ Public constants36100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.60MB with 0.42MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png132.00KB38.41KB▼ 70.90%
screenshot-4.png106.88KB31.16KB▼ 70.85%
screenshot-2.png182.49KB62.14KB▼ 65.95%
screenshot-1.png196.59KB63.65KB▼ 67.63%