84% dead-trees

Code Review | DeadTrees

WordPress plugin DeadTrees scored84%from 54 tests.

About plugin

  • Plugin page: dead-trees
  • Plugin version: 1.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Jul 9, 2012
  • Latest release: Jan 22, 2020
  • Number of updates: 13
  • Update frequency: every 211.8 days
  • Top authors: johnnyb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,176 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
Install script ran successfully

Server metrics [RAM: ▲0.22MB] [CPU: ▼3.93ms] Passed 4 tests

A check of server-side resources used by DeadTrees
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2042.01 ▲1.78
Dashboard /wp-admin3.54 ▲0.2350.31 ▲2.17
Posts /wp-admin/edit.php3.65 ▲0.2950.78 ▲1.92
Add New Post /wp-admin/post-new.php6.12 ▲0.2388.01 ▼18.64
Media Library /wp-admin/upload.php3.46 ▲0.2236.22 ▼0.79
Dead Trees /wp-admin/options-general.php?page=dt-settings3.4232.56
Add New /wp-admin/post-new.php?post_type=dt_book3.6752.29
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=dt_book3.4535.13
All Books /wp-admin/edit.php?post_type=dt_book3.5035.16
Writers /wp-admin/edit-tags.php?taxonomy=dt_writer&post_type=dt_book3.4533.60

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 10 new options
New WordPress options
dt_default_cover_size
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
dt_send_bookbox_css
dt_auto_add_bookbox
widget_recent-comments
dt_default_to_dev_affiliate

Browser metrics Passed 4 tests

DeadTrees: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,844 ▲9814.74 ▲0.441.74 ▼0.0343.55 ▲3.17
Dashboard /wp-admin2,248 ▲605.90 ▲1.0494.83 ▼6.0940.75 ▼2.65
Posts /wp-admin/edit.php2,131 ▲422.05 ▲0.0441.94 ▲5.4236.58 ▲1.36
Add New Post /wp-admin/post-new.php1,567 ▲5323.24 ▲5.51648.74 ▼80.6758.07 ▲4.59
Media Library /wp-admin/upload.php1,427 ▲394.16 ▲0.0293.51 ▼20.2640.67 ▼6.86
Dead Trees /wp-admin/options-general.php?page=dt-settings9942.0423.9130.93
Add New /wp-admin/post-new.php?post_type=dt_book2,8368.14180.9173.33
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=dt_book1,3432.1324.9828.31
All Books /wp-admin/edit.php?post_type=dt_book1,1511.9229.8030.85
Writers /wp-admin/edit-tags.php?taxonomy=dt_writer&post_type=dt_book1,2732.1525.1027.97

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
The following items require your attention
  • The uninstall procedure has failed, leaving 10 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • dt_default_cover_size
    • db_upgraded
    • dt_auto_add_bookbox
    • widget_recent-comments
    • dt_send_bookbox_css
    • can_compress_scripts
    • theysaidso_admin_options
    • dt_default_to_dev_affiliate

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
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
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dead-trees/deadtrees.php:1052
    • > PHP Fatal error
      Uncaught Error: Call to undefined function dt_get_bookbox_image() in wp-content/plugins/dead-trees/template/deadtree-bookbox.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/dead-trees/admin/bookbox_metabox_contents.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/dead-trees/admin/options.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
4 plugin tags: library, books, book, reading

dead-trees/deadtrees.php 92% from 13 tests

The main file in "DeadTrees" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("dead-trees.php" instead of "deadtrees.php")

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 plugin913 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP537260823
Markdown128047
CSS28243

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity101.00
▷ Minimum class complexity101.00
▷ Maximum class complexity101.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods57
▷ Static methods35.26%
▷ Public methods4477.19%
▷ Protected methods1322.81%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.57MB with 0.39MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png52.22KB13.85KB▼ 73.48%
screenshot-1.png240.83KB78.19KB▼ 67.53%
screenshot-2.png254.56KB83.66KB▼ 67.14%
screenshot-4.png34.85KB11.54KB▼ 66.89%