10% sdi-scarcity-timer

Code Review | SDI Scarcity Timer

WordPress plugin SDI Scarcity Timer scored 10% from 54 tests.

About plugin

  • Plugin page: sdi-scarcity-timer
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.0
  • WordPress version: 6.3.1
  • First release: Mar 26, 2019
  • Latest release: Mar 26, 2019
  • Number of updates: 2
  • Update frequency: every 5.5 days
  • Top authors: centraleffects (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 441 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/sdi-scarcity-timer/includes/class-campaign.php+200
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▼1.87MB] [CPU: ▼58.81ms] Passed 4 tests

Server-side resources used by SDI Scarcity Timer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.12 ▼1.345.69 ▼36.02
Dashboard /wp-admin2.14 ▼1.176.98 ▼52.56
Posts /wp-admin/edit.php2.14 ▼1.227.14 ▼48.99
Add New Post /wp-admin/post-new.php2.14 ▼3.756.57 ▼97.65
Media Library /wp-admin/upload.php2.14 ▼1.096.99 ▼30.42
New Campaign /wp-admin/admin.php?page=sdi-scarcity-new2.146.40
Settings /wp-admin/admin.php?page=sdi-scarcity-settings2.147.24
SDI Scarcity /wp-admin/admin.php?page=sdi-scarcity2.147.10

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 27 new files
Database: 2 new tables, 6 new options
New tables
wp_sdi_scarcity_timer_users
wp_sdi_scarcity_timer
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by SDI Scarcity Timer
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,858 ▲12314.74 ▲0.362.03 ▲0.0939.55 ▼12.57
Dashboard /wp-admin2,235 ▲504.81 ▼1.04108.87 ▼14.2638.55 ▼12.98
Posts /wp-admin/edit.php2,121 ▲322.02 ▲0.0143.63 ▲4.8535.39 ▲1.80
Add New Post /wp-admin/post-new.php1,552 ▲1923.21 ▼0.08656.27 ▼9.44104.75 ▲47.49
Media Library /wp-admin/upload.php1,417 ▲264.25 ▼0.03112.24 ▲4.0845.64 ▲1.65
New Campaign /wp-admin/admin.php?page=sdi-scarcity-new1,0551.9431.5036.61
Settings /wp-admin/admin.php?page=sdi-scarcity-settings7991.8531.8327.29
SDI Scarcity /wp-admin/admin.php?page=sdi-scarcity8141.8428.5327.12

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/sdi-scarcity-timer/includes/class-campaign.php+200
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_sdi_scarcity_timer
    • wp_sdi_scarcity_timer_users
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sdi-scarcity
    • > Deprecated in wp-content/plugins/sdi-scarcity-timer/includes/class-campaign.php+200
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

SRP 0% 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 take a closer look at the following
  • 7× PHP files output text when accessed directly:
    • > /wp-content/plugins/sdi-scarcity-timer/admin/top.php
    • > /wp-content/plugins/sdi-scarcity-timer/templates/ultimate/timer.php
    • > /wp-content/plugins/sdi-scarcity-timer/admin/elements/campaign-form.php
    • > /wp-content/plugins/sdi-scarcity-timer/templates/plain/timer.php
    • > /wp-content/plugins/sdi-scarcity-timer/admin/index.php
    • > /wp-content/plugins/sdi-scarcity-timer/templates/military/timer.php
    • > /wp-content/plugins/sdi-scarcity-timer/templates/sports/timer.php
  • 38× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: headline_placement in wp-content/plugins/sdi-scarcity-timer/templates/military/timer.php on line 29
    • > PHP Notice
      Undefined variable: timerEnd in wp-content/plugins/sdi-scarcity-timer/templates/military/timer.php on line 4
    • > PHP Notice
      Undefined variable: headline_placement in wp-content/plugins/sdi-scarcity-timer/templates/plain/timer.php on line 14
    • > PHP Notice
      Undefined variable: headline_placement in wp-content/plugins/sdi-scarcity-timer/templates/ultimate/timer.php on line 9
    • > PHP Notice
      Undefined variable: timerStart in wp-content/plugins/sdi-scarcity-timer/templates/ultimate/timer.php on line 3
    • > PHP Notice
      Undefined variable: campaignId in wp-content/plugins/sdi-scarcity-timer/templates/ultimate/timer.php on line 2
    • > PHP Notice
      Undefined variable: headline_placement in wp-content/plugins/sdi-scarcity-timer/templates/plain/timer.php on line 14
    • > PHP Notice
      Undefined variable: timerEnd in wp-content/plugins/sdi-scarcity-timer/templates/ultimate/timer.php on line 4
    • > PHP Notice
      Undefined variable: timerStart in wp-content/plugins/sdi-scarcity-timer/templates/sports/timer.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/sdi-scarcity-timer/includes/bootstrap.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sdi-scarcity
    • > Network (severe)
    wp-content/plugins/sdi-scarcity/admin/css/style.css?ver=1.0.0 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: product timer, scarcity, timer

sdi-scarcity-timer/wp-sdi-scarcity.php 77% from 13 tests

"SDI Scarcity Timer" version 0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sdi-scarcity-timer.php" instead of "wp-sdi-scarcity.php")
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin837 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP18110165664
CSS244135
JavaScript1131038

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity9.25
▷ Minimum class complexity4.00
▷ Maximum class complexity17.00
Average method complexity2.22
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods27
▷ Static methods1762.96%
▷ Public methods27100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions956.25%
▷ Anonymous functions743.75%
Constants5
▷ Global constants5100.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
PNG images were not found in this plugin