10% resource-library

Code Review | Resource Library

WordPress plugin Resource Library scored10%from 54 tests.

About plugin

  • Plugin page: resource-library
  • Plugin version: 0.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.2.1
  • WordPress version: 6.3.1
  • First release: Apr 9, 2015
  • Latest release: May 6, 2015
  • Number of updates: 7
  • Update frequency: every 9.9 days
  • Top authors: mightydigital (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /1,737 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/resource-library/inc/WPAlchemy/MetaBox.php+55
    Methods with the same name as their class will not be constructors in a future version of PHP; WPAlchemy_MetaBox has a deprecated constructor

Server metrics [RAM: ▼1.51MB] [CPU: ▼55.09ms] Passed 4 tests

Server-side resources used by Resource Library
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.49 ▼0.987.08 ▼37.48
Dashboard /wp-admin2.51 ▼0.848.97 ▼56.72
Posts /wp-admin/edit.php2.51 ▼0.858.35 ▼46.28
Add New Post /wp-admin/post-new.php2.51 ▼3.389.07 ▼79.87
Media Library /wp-admin/upload.php2.51 ▼0.726.88 ▼33.29
Add New /wp-admin/post-new.php?post_type=mdresourcelib2.517.92
Categories /wp-admin/edit-tags.php?taxonomy=groups&post_type=mdresourcelib2.517.53
All Resources /wp-admin/edit.php?post_type=mdresourcelib2.517.48

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 212 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
groups_children
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Resource Library: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,078 ▲33215.34 ▲0.955.88 ▲4.0937.09 ▼6.72
Dashboard /wp-admin2,394 ▲2066.43 ▲1.53115.72 ▲11.2239.82 ▼2.82
Posts /wp-admin/edit.php2,310 ▲2213.34 ▲1.3448.21 ▲11.0629.98 ▼3.47
Add New Post /wp-admin/post-new.php1,571 ▲3723.13 ▲0.10596.33 ▼105.1932.82 ▼27.32
Media Library /wp-admin/upload.php1,447 ▲624.26 ▲0.0779.94 ▼36.1442.02 ▼2.59
Add New /wp-admin/post-new.php?post_type=mdresourcelib1,8713.5769.1347.91
Categories /wp-admin/edit-tags.php?taxonomy=groups&post_type=mdresourcelib1,6373.1343.3232.17
All Resources /wp-admin/edit.php?post_type=mdresourcelib1,2763.3641.8828.22

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/resource-library/inc/WPAlchemy/MetaBox.php+55
    Methods with the same name as their class will not be constructors in a future version of PHP; WPAlchemy_MetaBox has a deprecated constructor
  • Incomplete uninstall procedure, leaving 212 files (0.62MB) in the plugin directory
    • (new file) inc/Twig/Error/Loader.php
    • (new file) inc/Twig/Compiler.php
    • (new file) inc/Symfony/Component/ClassLoader/Psr4ClassLoader.php
    • (new file) inc/Twig/CompilerInterface.php
    • (new file) inc/MightyDev/ResourcePluginController.php
    • (new file) inc/Twig/Environment.php
    • (new file) inc/MightyDev/helpers.php
    • (new file) inc/Twig/Autoloader.php
    • (new file) inc/MightyDev/PluginController.php
    • (new file) inc/Twig/Error.php
    • ...
  • Zombie WordPress options detected upon uninstall: 8 options
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • groups_children
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=mdresourcelib
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/resource-library/inc/WPAlchemy/MetaBox.php+55
    Methods with the same name as their class will not be constructors in a future version of PHP; WPAlchemy_MetaBox has a deprecated constructor

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
Please take a closer look at the following
  • 149× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/resource-library/inc/Twig/Test/NodeTestCase.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Error' not found in wp-content/plugins/resource-library/inc/Twig/Error/Runtime.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/resource-library/inc/Twig/Node/Print.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression' not found in wp-content/plugins/resource-library/inc/Twig/Node/Expression/Call.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/resource-library/inc/Twig/Node/Expression/Binary/BitwiseXor.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/resource-library/inc/Twig/Node/Expression/Binary/Sub.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_ParserInterface' not found in wp-content/plugins/resource-library/inc/Twig/Parser.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Unary' not found in wp-content/plugins/resource-library/inc/Twig/Node/Expression/Unary/Not.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Extension' not found in wp-content/plugins/resource-library/inc/Twig/Extension/Escaper.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/resource-library/inc/Twig/Node/Macro.php:17

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === resource-library === )
Please take inspiration from this readme.txt

resource-library/resource.php 92% from 13 tests

The primary PHP file in "Resource Library" version 0.1.2 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("resource-library.php" instead of "resource.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin11,502 lines of code in 206 files:
LanguageFilesBlank linesComment linesLines of code
PHP1912,3515,73910,360
CSS82545420
HTML321373
JSON100226
JavaScript20276
SVG10047

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity7.94
▷ Minimum class complexity1.00
▷ Maximum class complexity239.00
Average method complexity2.61
▷ Minimum method complexity1.00
▷ Maximum method complexity68.00
Code structure
Namespaces5
Interfaces19
Traits0
Classes169
▷ Abstract classes148.28%
▷ Concrete classes15591.72%
▷ Final classes00.00%
Methods860
▷ Static methods141.63%
▷ Public methods76088.37%
▷ Protected methods9410.93%
▷ Private methods60.70%
Functions57
▷ Named functions4985.96%
▷ Anonymous functions814.04%
Constants58
▷ Global constants1831.03%
▷ Class constants4068.97%
▷ Public constants40100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin