78% custom-resources

Code Review | Custom Resources

WordPress plugin Custom Resources scored78%from 54 tests.

About plugin

  • Plugin page: custom-resources
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.8
  • WordPress version: 6.3.1
  • First release: Jan 20, 2014
  • Latest release: Feb 9, 2014
  • Number of updates: 24
  • Update frequency: every 0.8 days
  • Top authors: fineswap (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,876 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
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼2.46ms] Passed 4 tests

This is a short check of server-side resources used by Custom Resources
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1138.23 ▼4.62
Dashboard /wp-admin3.40 ▲0.0651.45 ▼13.57
Posts /wp-admin/edit.php3.45 ▲0.1061.92 ▲11.59
Add New Post /wp-admin/post-new.php5.98 ▲0.0996.63 ▲5.93
Media Library /wp-admin/upload.php3.32 ▲0.1039.72 ▲2.43
Custom Resources /wp-admin/options-general.php?page=custom_resources3.3332.86

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 16 new options
New WordPress options
cr_script_load_backend
theysaidso_admin_options
widget_recent-comments
cr_styles_external
widget_theysaidso_widget
cr_styles_absolute
cr_script_absolute
db_upgraded
cr_script_inline
cr_script_external
...

Browser metrics Passed 4 tests

Custom Resources: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4913.31 ▼0.991.81 ▼0.7940.41 ▼3.02
Dashboard /wp-admin2,203 ▲124.86 ▼0.02139.20 ▲31.3342.33 ▲0.64
Posts /wp-admin/edit.php2,095 ▲62.06 ▲0.0539.98 ▲1.7136.90 ▲1.63
Add New Post /wp-admin/post-new.php1,519 ▼1417.66 ▼5.63671.64 ▲3.1957.64 ▲13.01
Media Library /wp-admin/upload.php1,391 ▲34.29 ▲0.06102.08 ▼5.7544.11 ▼2.34
Custom Resources /wp-admin/options-general.php?page=custom_resources1,0582.0626.7135.18

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Org\\Fineswap\\OpenSource\\CustomResources\\settings_fields() in wp-content/plugins/custom-resources/output.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Org\\Fineswap\\OpenSource\\CustomResources\\__() in wp-content/plugins/custom-resources/controller.php:19
    • > PHP Warning
      Use of undefined constant TITLE - assumed 'TITLE' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-resources/output.php on line 32

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=custom_resources
    • > Network (severe)
    https://cdn.fineswap.com/+sun2feb1537/logo.png - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (Showing TEXTAREA controls to enter custom styles and scripts.), #2 (Showing CHECKBOX controls to control where should styles and/or scripts load.)
The official readme.txt is a good inspiration

custom-resources/controller.php 85% from 13 tests

The entry point to "Custom Resources" version 1.0.7 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 143 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("custom-resources.php" instead of "controller.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 plugin431 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP270106300
CSS1230131

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity21.00
▷ Minimum class complexity21.00
▷ Maximum class complexity21.00
Average method complexity2.54
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods17.69%
▷ Public methods1076.92%
▷ Protected methods00.00%
▷ Private methods323.08%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants15100.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
5 compressed PNG files occupy 0.05MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
google.png1.54KB1.43KB▼ 7.03%
screenshot-2.png21.22KB21.17KB0.24%
screenshot-1.png21.75KB21.77KB0.00%
facebook.png1.25KB1.07KB▼ 14.35%
twitter.png1.44KB1.29KB▼ 10.96%