68% whistles

Code Review | Whistles

WordPress plugin Whistles scored68%from 54 tests.

About plugin

  • Plugin page: whistles
  • Plugin version: 0.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-3.7.1
  • WordPress version: 6.3.1
  • First release: Sep 9, 2013
  • Latest release: Nov 1, 2013
  • Number of updates: 3
  • Update frequency: every 17.7 days
  • Top authors: greenshady (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

700+ active /18,645 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.52MB] [CPU: ▼50.25ms] Passed 4 tests

Analyzing server-side resources used by Whistles
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.46 ▼1.009.87 ▼29.88
Dashboard /wp-admin2.50 ▼0.8412.69 ▼49.44
Posts /wp-admin/edit.php2.50 ▼0.8512.43 ▼35.51
Add New Post /wp-admin/post-new.php2.50 ▼3.3811.49 ▼86.18
Media Library /wp-admin/upload.php2.50 ▼0.7211.10 ▼24.65
Whistle Groups /wp-admin/edit-tags.php?taxonomy=whistle_group&post_type=whistle2.5014.11
Whistles /wp-admin/edit.php?post_type=whistle2.5013.28

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_whistles
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Whistles
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲9514.76 ▲0.001.87 ▲0.0742.18 ▲2.00
Dashboard /wp-admin2,217 ▲295.02 ▼0.83109.32 ▲5.1037.97 ▼2.63
Posts /wp-admin/edit.php2,100 ▲112.05 ▲0.0142.26 ▲1.0734.91 ▼1.73
Add New Post /wp-admin/post-new.php1,572 ▲3023.23 ▲5.13626.76 ▲16.5262.53 ▲11.41
Media Library /wp-admin/upload.php1,393 ▲24.21 ▲0.0098.85 ▲1.0043.52 ▼0.98
Whistle Groups /wp-admin/edit-tags.php?taxonomy=whistle_group&post_type=whistle1,2422.1326.7526.43
Whistles /wp-admin/edit.php?post_type=whistle1,0721.9530.6227.40

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in Whistles_Widget is deprecated since version 4.3.0! Use __construct() instead.
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • widget_whistles
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=whistle
    • > POST request to /wp-admin/admin-ajax.php
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in Whistles_Widget is deprecated since version 4.3.0! Use __construct() instead.

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
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/whistles/inc/post-types.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/whistles/inc/functions.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/whistles/inc/class-whistles-widget.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Whistles_And_Bells' not found in wp-content/plugins/whistles/inc/class-whistles-and-accordions.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Whistles_And_Bells' not found in wp-content/plugins/whistles/inc/class-whistles-and-toggles.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/whistles/inc/taxonomies.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/whistles/whistles.php:48
    • > PHP Fatal error
      Uncaught Error: Class 'Whistles_And_Bells' not found in wp-content/plugins/whistles/inc/class-whistles-and-tabs.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/whistles/admin/admin.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Add `[whistles]` shortcode media button popup), #2 (Manage Whistles admin screen), #3 (Accordions view), #4 (Tabs view), #5 (Toggles view)
You can take inspiration from this readme.txt

whistles/whistles.php Passed 13 tests

This is the main PHP file of "Whistles" version 0.1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
99 characters long description:
A plugin for managing tabs, toggles, accordions, and other types of content on a WordPress install.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin806 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP10208492625
CSS2191596
JavaScript210357
Markdown121028

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity6.67
▷ Minimum class complexity4.00
▷ Maximum class complexity11.00
Average method complexity2.70
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes116.67%
Methods20
▷ Static methods840.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
5 compressed PNG files occupy 0.10MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png59.85KB58.50KB▼ 2.27%
screenshot-2.png12.31KB12.29KB0.20%
screenshot-1.png10.01KB9.99KB0.27%
screenshot-3.png6.45KB6.29KB▼ 2.45%
screenshot-4.png10.95KB10.78KB▼ 1.58%