84% toot

Code Review | Toot

WordPress plugin Toot scored84%from 54 tests.

About plugin

  • Plugin page: toot
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.9.1
  • WordPress version: 6.3.1
  • First release: Dec 21, 2017
  • Latest release: Dec 21, 2017
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: greenshady (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,291 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.41MB] [CPU: ▼7.80ms] Passed 4 tests

An overview of server-side resources used by Toot
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2843.94 ▲1.77
Dashboard /wp-admin3.79 ▲0.4455.08 ▼14.92
Posts /wp-admin/edit.php3.84 ▲0.4951.42 ▼5.46
Add New Post /wp-admin/post-new.php6.39 ▲0.5189.52 ▼12.57
Media Library /wp-admin/upload.php3.64 ▲0.4240.97 ▲7.22
Add New /wp-admin/post-new.php?post_type=testimonial6.3991.58
Settings /wp-admin/edit.php?post_type=testimonial&page=toot-settings3.6742.64
Categories /wp-admin/edit-tags.php?taxonomy=testimonial_category&post_type=testimonial3.6437.47
Testimonials /wp-admin/edit.php?post_type=testimonial3.7741.24

Server storage [IO: ▲0.44MB] [DB: ▲0.31MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Toot
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8114.73 ▲0.081.96 ▲0.0546.01 ▼2.09
Dashboard /wp-admin2,230 ▲595.61 ▲0.0183.42 ▼4.1039.36 ▼6.45
Posts /wp-admin/edit.php2,135 ▲732.01 ▼0.0037.44 ▼0.4435.07 ▲2.62
Add New Post /wp-admin/post-new.php1,574 ▲4323.53 ▲0.38675.20 ▲52.3461.81 ▲12.77
Media Library /wp-admin/upload.php1,435 ▲324.18 ▼0.04110.30 ▲9.2551.35 ▲7.17
Add New /wp-admin/post-new.php?post_type=testimonial6,30421.99907.7038.01
Settings /wp-admin/edit.php?post_type=testimonial&page=toot-settings1,7136.60138.3967.42
Categories /wp-admin/edit-tags.php?taxonomy=testimonial_category&post_type=testimonial1,3062.1427.1430.12
Testimonials /wp-admin/edit.php?post_type=testimonial1,2111.9533.2029.22

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 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
Please take a closer look at the following
  • 12× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/toot/inc/functions-shortcodes.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Toot\\trailingslashit() in wp-content/plugins/toot/toot.php:141
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/toot/inc/functions-meta.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/toot/uninstall.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/toot/inc/functions-filters.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Toot\\add_action() in wp-content/plugins/toot/admin/class-manage-testimonials.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/toot/admin/functions-admin.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/toot/inc/functions-taxonomies.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Toot\\add_action() in wp-content/plugins/toot/admin/class-testimonial-edit.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/toot/inc/functions-post-types.php:14

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
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (Example testimonial on the front end), #2 (Edit testimonial screen), #3 (Manage testimonials screen), #4 (Plugin settings screen)
You can look at the official readme.txt

toot/toot.php 92% from 13 tests

The primary PHP file in "Toot" version 1.0.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin1,809 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP185741,4251,369
Markdown41380405
JavaScript2151335

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity15.25
▷ Minimum class complexity4.00
▷ Maximum class complexity26.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes4100.00%
Methods57
▷ Static methods47.02%
▷ Public methods5087.72%
▷ Protected methods00.00%
▷ Private methods712.28%
Functions73
▷ Named functions73100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.30MB with 0.17MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png69.36KB31.10KB▼ 55.17%
screenshot-3.png75.89KB32.70KB▼ 56.91%
screenshot-2.png87.24KB38.43KB▼ 55.95%
screenshot-1.png72.43KB26.77KB▼ 63.04%