89% custom-code

Code Review | Custom Code

WordPress plugin Custom Code scored 89% from 54 tests.

About plugin

  • Plugin page: custom-code
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.8.1
  • WordPress version: 5.8.1
  • First release: Feb 22, 2014
  • Latest release: Mar 2, 2014
  • Number of updates: 5
  • Update frequency: every 1.8 days
  • Top authors: bhagirath25 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

50+ active / 6,639 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.30MB] [CPU: ▼158.24ms] Passed 4 tests

An overview of server-side resources used by Custom Code
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.0433.75 ▼3.05
Dashboard /wp-admin3.10 ▲0.0548.58 ▲0.36
Posts /wp-admin/edit.php3.16 ▲0.0547.39 ▲1.45
Add New Post /wp-admin/post-new.php4.09 ▼1.3546.00 ▼626.37
Media Library /wp-admin/upload.php3.05 ▲0.0529.13 ▼3.90
All Custom Codes /wp-admin/edit.php?post_type=custom_code3.0930.84
Add Custom Code /wp-admin/post-new.php?post_type=custom_code2.9833.75

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Custom Code
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,747 ▲17516.10 ▲0.1010.29 ▼0.5949.48 ▼0.78
Dashboard /wp-admin3,005 ▲686.06 ▲0.06146.14 ▼8.33105.89 ▼5.78
Posts /wp-admin/edit.php2,774 ▲352.72 ▼0.0064.81 ▲1.3792.35 ▲1.21
Add New Post /wp-admin/post-new.php1,706 ▲2318.24 ▼0.51409.56 ▲14.65114.55 ▲9.81
Media Library /wp-admin/upload.php1,842 ▲355.04 ▲0.02145.56 ▼3.81123.45 ▲10.88
All Custom Codes /wp-admin/edit.php?post_type=custom_code1,4312.6269.9574.80
Add Custom Code /wp-admin/post-new.php?post_type=custom_code2,0163.3091.14104.99

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=custom_code
    • > Notice in wp-content/plugins/custom-code/custom-code.php+101
    Undefined index: custom_code_noncename

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-code/custom-code.php:14

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)
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: css, post, custom post, script, header...

custom-code/custom-code.php Passed 13 tests

The main PHP script in "Custom Code" version 1.1 is automatically included on every request by WordPress
51 characters long description:
Add Custom script and CSS code to header and footer

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected161 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP15153161

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin