84% casa-reference

Code Review | CASA Reference

WordPress plugin CASA Reference scored 84% from 54 tests.

About plugin

  • Plugin page: casa-reference
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.3
  • WordPress version: 6.3.1
  • First release: Feb 29, 2016
  • Latest release: Mar 6, 2016
  • Number of updates: 6
  • Update frequency: every 1.0 days
  • Top authors: tomalrussell (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 701 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.05MB] [CPU: ▼5.01ms] Passed 4 tests

Analyzing server-side resources used by CASA Reference
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0536.44 ▼7.99
Dashboard /wp-admin3.35 ▲0.0545.39 ▼4.73
Posts /wp-admin/edit.php3.47 ▲0.1151.10 ▲5.73
Add New Post /wp-admin/post-new.php5.96 ▲0.0784.19 ▼10.08
Media Library /wp-admin/upload.php3.27 ▲0.0438.70 ▲2.75
References /wp-admin/options-general.php?page=casa-reference-settings3.2432.34
All References /wp-admin/edit.php?post_type=reference3.3235.73
Upload /wp-admin/edit.php?post_type=reference&page=casa-reference-upload3.2431.66
Add New /wp-admin/post-new.php?post_type=reference3.3345.16

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for CASA Reference
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,871 ▲13613.59 ▼0.811.88 ▲0.0641.52 ▼1.08
Dashboard /wp-admin2,246 ▲554.91 ▼0.99102.97 ▼2.0637.62 ▼4.23
Posts /wp-admin/edit.php2,135 ▲492.07 ▲0.0640.80 ▲4.1235.87 ▼2.08
Add New Post /wp-admin/post-new.php6,494 ▲4,96120.34 ▼2.91933.84 ▲271.8868.83 ▲3.01
Media Library /wp-admin/upload.php1,431 ▲434.22 ▲0.06106.30 ▼5.6945.19 ▼3.36
References /wp-admin/options-general.php?page=casa-reference-settings7871.7129.0726.80
All References /wp-admin/edit.php?post_type=reference1,0932.0233.8328.89
Upload /wp-admin/edit.php?post_type=reference&page=casa-reference-upload8121.7124.3429.79
Add New /wp-admin/post-new.php?post_type=reference1,9503.7061.9830.60

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Casa\\Reference\\Create\\add_action() in wp-content/plugins/casa-reference/lib/create.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Casa\\Reference\\Output\\add_filter() in wp-content/plugins/casa-reference/lib/output.php:52
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Casa\\Reference\\Associate\\add_action() in wp-content/plugins/casa-reference/lib/associate.php:24

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: publications, ucl, references

casa-reference/loader.php 92% from 13 tests

"CASA Reference" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("casa-reference.php" instead of "loader.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin635 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP78555508
JavaScript28179
CSS21148

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions33
▷ Named functions33100.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/chosen-sprite.png0.53KB0.88KB0.00%
admin/chosen-sprite@2x.png0.72KB0.83KB0.00%