62% resources-review

Code Review | Resource Review

WordPress plugin Resource Review scored62%from 54 tests.

About plugin

  • Plugin page: resources-review
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.1.2
  • WordPress version: 6.3.1
  • First release: Apr 17, 2015
  • Latest release: Apr 23, 2015
  • Number of updates: 37
  • Update frequency: every 0.2 days
  • Top authors: nhensh (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,036 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.79MB] [CPU: ▼40.71ms] Passed 4 tests

Server-side resources used by Resource Review
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1255.39 ▲12.60
Dashboard /wp-admin3.16 ▼0.1516.74 ▼29.33
Posts /wp-admin/edit.php3.16 ▼0.2017.42 ▼28.36
Add New Post /wp-admin/post-new.php3.16 ▼2.7319.17 ▼85.98
Media Library /wp-admin/upload.php3.16 ▼0.0717.89 ▼19.18
Add Resource /wp-admin/post-new.php?post_type=resources3.1617.34
Media Type /wp-admin/edit-tags.php?taxonomy=media-type&post_type=resources3.1628.21
All Resources /wp-admin/edit.php?post_type=resources3.1616.57

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Resource Review
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,000 ▲25414.78 ▲0.422.54 ▲0.6538.50 ▼4.91
Dashboard /wp-admin2,377 ▲1926.50 ▲0.62132.33 ▲22.5742.63 ▲1.96
Posts /wp-admin/edit.php2,283 ▲1913.29 ▲1.2948.16 ▲7.4530.14 ▼4.46
Add New Post /wp-admin/post-new.php1,569 ▲3623.43 ▲0.26607.93 ▼11.5332.83 ▼22.66
Media Library /wp-admin/upload.php1,419 ▲344.14 ▼0.0581.33 ▼24.1041.59 ▼4.04
Add Resource /wp-admin/post-new.php?post_type=resources2,8768.17210.52104.22
Media Type /wp-admin/edit-tags.php?taxonomy=media-type&post_type=resources1,8263.1540.5332.44
All Resources /wp-admin/edit.php?post_type=resources1,3043.2648.3327.44

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/resources-review/includes/metabox/init.php+746
    count(): Parameter must be an array or an object that implements Countable
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • media-type_children

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=resources
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/resources-review/includes/metabox/init.php+746
    count(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/post-new.php?post_type=resources
    • > Warning in wp-content/plugins/resources-review/resource-review.php+190
    Division by zero

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
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/resources-review/includes/metabox/tests/phpunit/includes/bootstrap.php
    • > /wp-content/plugins/resources-review/resource-review.php
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_ID() in wp-content/plugins/resources-review/resource-template.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/resources-review/includes/metabox/init.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/resources-review/includes/metabox/cmb-functions.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/resources-review/single-resource.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/resources-review/includes/metabox/tests/phpunit/tests/CMB_Core_Test.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: Screenshot #2 (http://plugins.svn.wordpress.org/resources-review/assets/nathanhensher-com-resource-review-shot1.jpg) image required
You can take inspiration from this readme.txt

resources-review/resource-review.php 92% from 13 tests

The main PHP file in "Resource Review" ver. 1.2 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("resources-review.php" instead of "resource-review.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin5,344 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript63174102,259
PHP126011,0832,047
CSS39932637
Markdown3830272
Bourne Shell115459
JSON10031
XML140130
HTML1109

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity57.14
▷ Minimum class complexity1.00
▷ Maximum class complexity136.00
Average method complexity3.93
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods134
▷ Static methods3425.37%
▷ Public methods13298.51%
▷ Protected methods21.49%
▷ Private methods00.00%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants266.67%
▷ Class constants133.33%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
15 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/metabox/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
includes/img/stars.png1.17KB0.54KB▼ 54.01%
includes/metabox/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
includes/metabox/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
includes/metabox/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%