83% script-logic

Code Review | Script Logic

WordPress plugin Script Logic scored 83% from 54 tests.

About plugin

  • Plugin page: script-logic
  • Plugin version: 0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.9.1
  • WordPress version: 5.8.1
  • First release: Jun 16, 2014
  • Latest release: Jul 10, 2014
  • Number of updates: 17
  • Update frequency: every 19.5 days
  • Top authors: tahiryasin (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 1,625 total downloads

Benchmarks

Plugin footprint Passed 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.04MB] [CPU: ▼171.62ms] Passed 4 tests

Analyzing server-side resources used by Script Logic
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.8864.90 ▲28.97
Dashboard /wp-admin3.10 ▲0.0452.50 ▼2.61
Posts /wp-admin/edit.php3.18 ▲0.0752.22 ▼4.55
Add New Post /wp-admin/post-new.php5.45 ▲0.02107.80 ▼686.54
Media Library /wp-admin/upload.php3.04 ▲0.0439.84 ▲7.21
Script Logic /wp-admin/options-general.php?page=sb_scriptlogic_options3.0332.98

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Script Logic
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,713 ▲7615.85 ▲0.2214.71 ▲3.9151.75 ▼5.42
Dashboard /wp-admin2,980 ▲495.98 ▼0.23155.51 ▼13.02121.89 ▼2.28
Posts /wp-admin/edit.php2,749 ▲102.73 ▲0.0174.76 ▼2.82100.41 ▲4.63
Add New Post /wp-admin/post-new.php1,690 ▲7515.73 ▼5.52459.52 ▲118.26112.20 ▼4.06
Media Library /wp-admin/upload.php1,829 ▲225.04 ▲0.03178.36 ▲7.74129.83 ▲3.48
Script Logic /wp-admin/options-general.php?page=sb_scriptlogic_options1,4662.5174.25104.36

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=sb_scriptlogic_options
    • > User deprecated in wp-includes/functions.php+5221
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=sb_scriptlogic_options
    • > User deprecated in wp-includes/functions.php+5221
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
Please fix the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/script-logic/script-logic.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/script-logic/options.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=sb_scriptlogic_options
    • > Network (severe)
    wp-content/plugins/script-logic/css/images/ui-bg_flat_75_ffffff_40x100.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=sb_scriptlogic_options
    • > Network (severe)
    wp-content/plugins/script-logic/css/images/ui-bg_glass_75_e6e6e6_1x400.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=sb_scriptlogic_options
    • > Network (severe)
    wp-content/plugins/script-logic/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=sb_scriptlogic_options
    • > Network (severe)
    wp-content/plugins/script-logic/css/images/ui-bg_glass_65_ffffff_1x400.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Donate link: Invalid URI ("")
You can take inspiration from this readme.txt

script-logic/script-logic.php Passed 13 tests

The entry point to "Script Logic" version 0.3 is a PHP file that has certain tags in its header comment area
68 characters long description:
Control scripts & stylesheets with WP's conditional tags is_home etc

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin688 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
CSS24544395
PHP23438293

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity33.00
▷ Minimum class complexity33.00
▷ Maximum class complexity33.00
Average method complexity4.20
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods440.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/cf7-js.png8.83KB4.24KB▼ 51.94%
images/cf7-css.png8.32KB4.19KB▼ 49.59%