84% add-script-to-post

Code Review | Add Script To Post

WordPress plugin Add Script To Post scored84%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: 6.3.1
  • 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

30+ active /2,739 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.00MB] [CPU: ▼8.99ms] Passed 4 tests

This is a short check of server-side resources used by Add Script To Post
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.64 ▼7.51
Dashboard /wp-admin3.31 ▼0.0346.89 ▼21.93
Posts /wp-admin/edit.php3.36 ▲0.0145.81 ▼2.09
Add New Post /wp-admin/post-new.php5.89 ▲0.0186.53 ▼4.44
Media Library /wp-admin/upload.php3.24 ▲0.0140.72 ▲5.02

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Add Script To Post
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.37 ▲0.021.73 ▼0.1738.11 ▼9.56
Dashboard /wp-admin2,183 ▲35.53 ▼0.1291.22 ▼6.4843.52 ▼1.59
Posts /wp-admin/edit.php2,097 ▼02.01 ▲0.0135.15 ▼2.3433.77 ▼5.16
Add New Post /wp-admin/post-new.php1,533 ▲722.99 ▼0.10663.44 ▼11.6752.87 ▼1.36
Media Library /wp-admin/upload.php1,397 ▼34.20 ▼0.02103.69 ▼8.4445.39 ▼7.33

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

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)
Good news, no errors were detected

SRP 50% 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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > 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 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: post, style, shortcode

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

The main PHP script in "Add Script To Post" version 1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Domain Path: The domain path points to a folder that does not exist ("/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
There were no executable files found in this plugin29 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1122529

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
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

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected