74% wp-cowsay

Code Review | WP Cowsay

WordPress plugin WP Cowsay scored74%from 54 tests.

About plugin

  • Plugin page: wp-cowsay
  • Plugin version: 0.1.13
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.1.1
  • WordPress version: 6.3.1
  • First release: Aug 13, 2017
  • Latest release: Apr 2, 2019
  • Number of updates: 13
  • Update frequency: every 49.3 days
  • Top authors: kamataryo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /797 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

Analyzing server-side resources used by WP Cowsay
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.04 ▼1.62
Dashboard /wp-admin3.31 ▲0.0158.35 ▲2.15
Posts /wp-admin/edit.php3.36 ▲0.0154.61 ▲4.44
Add New Post /wp-admin/post-new.php5.89 ▲0.01105.02 ▲4.97
Media Library /wp-admin/upload.php3.24 ▲0.0140.20 ▲1.79

Server storage [IO: ▲0.02MB] [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: 25 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by WP Cowsay
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.21 ▼1.371.61 ▼0.3242.79 ▼5.71
Dashboard /wp-admin2,206 ▲274.87 ▼0.00110.97 ▼8.4844.44 ▼1.60
Posts /wp-admin/edit.php2,089 ▼32.03 ▲0.0441.70 ▲6.1535.91 ▲1.25
Add New Post /wp-admin/post-new.php1,534 ▲123.13 ▲0.05655.57 ▼44.1058.94 ▲2.12
Media Library /wp-admin/upload.php1,391 ▲64.24 ▼0.04100.50 ▼15.0339.93 ▼7.68

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Cowsayphp\\AbstractAnimal' not found in wp-content/plugins/wp-cowsay/vendor/alrik11es/cowsayphp/src/Farm/Dragon.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'Cowsayphp\\AnimalInterface' not found in wp-content/plugins/wp-cowsay/vendor/alrik11es/cowsayphp/src/AbstractAnimal.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Cowsayphp\\AbstractAnimal' not found in wp-content/plugins/wp-cowsay/vendor/alrik11es/cowsayphp/src/Farm/Cow.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Cowsayphp\\AbstractAnimal' not found in wp-content/plugins/wp-cowsay/vendor/alrik11es/cowsayphp/src/Farm/Whale.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-cowsay/wp-cowsay.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Cowsayphp\\AbstractAnimal' not found in wp-content/plugins/wp-cowsay/vendor/alrik11es/cowsayphp/src/Farm/Tux.php:6

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: shortcode, cowsay

wp-cowsay/wp-cowsay.php Passed 13 tests

The main PHP script in "WP Cowsay" version 0.1.13 is automatically included on every request by WordPress
24 characters long description:
Enable Cowsay shortcode!

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
These items require your attention
  • Do not distribute dangerous files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/wp-cowsay/vendor/alrik11es/cowsayphp/bin/cowsayphp.bat
491 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP1159120260
Markdown4600144
JSON10045
PO File15733
JavaScript1107
DOS Batch1002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity1.80
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.57
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces2
Interfaces1
Traits0
Classes9
▷ Abstract classes111.11%
▷ Concrete classes888.89%
▷ Final classes00.00%
Methods15
▷ Static methods213.33%
▷ Public methods1386.67%
▷ Protected methods00.00%
▷ Private methods213.33%
Functions0
▷ Named functions00.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
No PNG files were detected