78% pound

Code Review | Pound :: Easy Unit Testing For WordPress

WordPress plugin Pound :: Easy Unit Testing For WordPress scored78%from 54 tests.

About plugin

  • Plugin page: pound
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.8
  • WordPress version: 6.3.1
  • First release: Mar 14, 2016
  • Latest release: Sep 29, 2017
  • Number of updates: 9
  • Update frequency: every 64.9 days
  • Top authors: reality66 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /707 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.76ms] Passed 4 tests

An overview of server-side resources used by Pound :: Easy Unit Testing For WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0234.61 ▼6.24
Dashboard /wp-admin3.32 ▲0.0148.59 ▼1.89
Posts /wp-admin/edit.php3.37 ▲0.0145.92 ▲1.01
Add New Post /wp-admin/post-new.php5.90 ▲0.0188.40 ▲1.97
Media Library /wp-admin/upload.php3.24 ▲0.0135.96 ▲0.08

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Pound :: Easy Unit Testing For WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4714.44 ▲0.071.75 ▼0.1840.44 ▼11.41
Dashboard /wp-admin2,206 ▲185.85 ▲0.98106.81 ▼11.9940.04 ▼2.70
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0040.21 ▲4.0235.53 ▲2.31
Add New Post /wp-admin/post-new.php1,546 ▲323.10 ▲4.93627.45 ▼1.6359.89 ▲7.55
Media Library /wp-admin/upload.php1,391 ▲64.22 ▼0.0196.47 ▼2.1343.61 ▼2.47

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/pound/views/html-test-results.php
  • 23× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to get property 'passed_messages' of non-object in wp-content/plugins/pound/views/html-test-results.php on line 4
    • > PHP Notice
      Trying to get property 'passed_messages' of non-object in wp-content/plugins/pound/views/html-test-results.php on line 40
    • > PHP Notice
      Undefined variable: results in wp-content/plugins/pound/views/html-test-results.php on line 26
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/pound/views/html-test-results.php on line 40
    • > PHP Fatal error
      Uncaught Error: Class 'LB_Test' not found in wp-content/plugins/pound/tests/class-test-group-two.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'LB_Test' not found in wp-content/plugins/pound/tests/class-test-group-one.php:3
    • > PHP Notice
      Undefined variable: results in wp-content/plugins/pound/views/html-test-results.php on line 40
    • > PHP Notice
      Undefined variable: results in wp-content/plugins/pound/views/html-test-results.php on line 42
    • > PHP Fatal error
      Uncaught Error: Class 'LB_Test' not found in wp-content/plugins/pound/tests/class-test-group-one.php:3
    • > PHP Notice
      Trying to get property 'skipped_messages' of non-object in wp-content/plugins/pound/views/html-test-results.php on line 42

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (Shortcode to run tests), #2 (Example output with a failing test)
The official readme.txt might help

pound/pound.php Passed 13 tests

The main PHP file in "Pound :: Easy Unit Testing For WordPress" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
43 characters long description:
Easily run unit tests for WordPress plugins

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
Success! There were no dangerous files found in this plugin326 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP1182100280
CSS111046

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity3.89
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity2.08
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes111.11%
Methods24
▷ Static methods1041.67%
▷ Public methods24100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png47.67KB17.42KB▼ 63.45%
screenshot-1.png8.99KB4.58KB▼ 49.05%