94% add-script-to-post

Code Review | Add Script To Post

WordPress plugin Add Script To Post scored 94% from 54 tests.

About plugin

  • Plugin page: add-script-to-post
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.8
  • WordPress version: 5.9.2
  • First release: Mar 18, 2014
  • Latest release: Mar 18, 2014
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: eflyjason (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 2,463 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 gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼297.21ms] Passed 4 tests

A check of server-side resources used by Add Script To Post
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0153.38 ▼0.53
Dashboard /wp-admin3.42 ▲0.0133.06 ▼1.18
Posts /wp-admin/edit.php3.65 ▲0.0137.65 ▲1.93
Add New Post /wp-admin/post-new.php6.89 ▼0.0894.43 ▼1,185.67
Media Library /wp-admin/upload.php3.30 ▲0.0122.97 ▼1.46

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Add Script To Post
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,785 ▲6315.83 ▲0.076.95 ▼0.242.13 ▼0.54
Dashboard /wp-admin2,895 ▲346.13 ▼0.03123.05 ▼14.51162.56 ▼2.65
Posts /wp-admin/edit.php2,691 ▼33.24 ▲0.0063.70 ▼3.59146.73 ▲5.26
Add New Post /wp-admin/post-new.php1,661 ▼017.03 ▲0.79406.02 ▲0.36156.83 ▼5.37
Media Library /wp-admin/upload.php1,701 ▲35.48 ▼0.04143.62 ▲4.72178.10 ▼4.25

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

Smoke tests 75% 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/add-script-to-post/add-script-to-post.php:34

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 issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: shortcode, post, style

add-script-to-post/add-script-to-post.php 92% from 13 tests

The main PHP file in "Add Script To Post" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Domain Path: The domain path folder was not found ("/lang/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected29 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1122529

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin