72% casehistory

Code Review | Case History

WordPress plugin Case History scored 72% from 54 tests.

About plugin

  • Plugin page: casehistory
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6.0-5.7.0
  • WordPress version: 6.3.1
  • First release: Feb 4, 2016
  • Latest release: Mar 16, 2021
  • Number of updates: 6
  • Update frequency: every 311.3 days
  • Top authors: rswstudio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 706 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.10MB] [CPU: ▼8.35ms] Passed 4 tests

A check of server-side resources used by Case History
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1035.79 ▼3.00
Dashboard /wp-admin3.26 ▼0.0438.94 ▼9.12
Posts /wp-admin/edit.php3.33 ▼0.0339.32 ▼6.34
Add New Post /wp-admin/post-new.php5.51 ▼0.3771.68 ▼14.94
Media Library /wp-admin/upload.php3.27 ▲0.0433.61 ▲2.09
Aggiungi Case History /wp-admin/post-new.php?post_type=casehistory3.3342.33
Tutti le Case History /wp-admin/edit.php?post_type=casehistory3.3136.73
Categorie /wp-admin/edit-tags.php?taxonomy=casehistory_cat&post_type=casehistory3.2629.27
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins3.2831.09
Tag /wp-admin/edit-tags.php?taxonomy=casehistory_tag&post_type=casehistory3.2630.90

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Case History
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,903 ▲16813.22 ▼1.071.70 ▼1.0837.58 ▼13.50
Dashboard /wp-admin2,281 ▲935.83 ▲0.9695.18 ▼20.6042.27 ▼0.00
Posts /wp-admin/edit.php2,175 ▲862.07 ▲0.0841.31 ▲5.8940.20 ▲5.95
Add New Post /wp-admin/post-new.php1,593 ▲7123.28 ▲0.17672.28 ▼11.7251.24 ▼11.47
Media Library /wp-admin/upload.php1,468 ▲804.24 ▼0.0197.70 ▼0.7947.50 ▲3.55
Aggiungi Case History /wp-admin/post-new.php?post_type=casehistory2,6577.67184.5483.66
Tutti le Case History /wp-admin/edit.php?post_type=casehistory1,1772.0034.3339.17
Categorie /wp-admin/edit-tags.php?taxonomy=casehistory_cat&post_type=casehistory1,3452.4228.2733.24
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins1,0012.0924.4726.70
Tag /wp-admin/edit-tags.php?taxonomy=casehistory_tag&post_type=casehistory1,3452.3328.8333.33

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

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

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=casehistory_tag&post_type=casehistory
    • > User deprecated in wp-includes/functions.php+5828
    Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.

SRP 0% 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/casehistory/casehistory.php
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/casehistory/class-tgm-plugin-activation.php:161
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/casehistory/casehistory_tassonomie.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/casehistory/casehistory_widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/casehistory/casehistory_metabox.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/casehistory/casehistory_pluginaggiuntivi.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/casehistory/casehistory_shortcode.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/casehistory/casehistory_opzioni.php:82

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% 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
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === casehistory === )
  • Screenshots: These screenshots do not have images: #1 (screenshot-1.jpg), #2 (screenshot-2.jpg)
You can take inspiration from this readme.txt

casehistory/casehistory.php Passed 13 tests

The main PHP file in "Case History" ver. 1.3.0 adds more information about the plugin and also serves as the entry point for this plugin
38 characters long description:
Case History, Case Study per wordpress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected1,615 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP83978021,538
PO File1222777

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity42.40
▷ Minimum class complexity6.00
▷ Maximum class complexity113.00
Average method complexity5.31
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods48
▷ Static methods12.08%
▷ Public methods4287.50%
▷ Protected methods612.50%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/prodotti.png0.98KB0.98KB0.00%