68% promotional-timer

Code Review | Promotional Timer

WordPress plugin Promotional Timer scored68%from 54 tests.

About plugin

  • Plugin page: promotional-timer
  • Plugin version: 1.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.4.1
  • WordPress version: 6.3.1
  • First release: Mar 14, 2023
  • Latest release: Nov 9, 2023
  • Number of updates: 3
  • Update frequency: every 80.0 days
  • Top authors: sidngr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /99 total downloads

Benchmarks

Plugin footprint 65% from 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.18MB] [CPU: ▼17.51ms] Passed 4 tests

An overview of server-side resources used by Promotional Timer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0636.43 ▼2.60
Dashboard /wp-admin3.13 ▼0.2233.33 ▼28.26
Posts /wp-admin/edit.php3.26 ▼0.1039.43 ▼7.65
Add New Post /wp-admin/post-new.php5.51 ▼0.3969.87 ▼31.51
Media Library /wp-admin/upload.php3.21 ▼0.0231.52 ▲0.23
Dashboard /wp-admin/admin.php?page=sn-pt-dashboard3.2738.91
Settings /wp-admin/admin.php?page=sn-pt-settings3.2738.73

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Promotional Timer: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲7214.68 ▲0.301.65 ▼0.0939.52 ▼3.45
Dashboard /wp-admin2,227 ▲535.62 ▼0.0494.42 ▲1.7571.23 ▲28.32
Posts /wp-admin/edit.php2,150 ▲502.08 ▲0.1238.77 ▲2.4735.08 ▲0.02
Add New Post /wp-admin/post-new.php1,555 ▲2623.11 ▼0.16686.23 ▲49.4851.01 ▼2.08
Media Library /wp-admin/upload.php1,444 ▲444.29 ▲0.11100.71 ▼5.5973.02 ▲30.45
Dashboard /wp-admin/admin.php?page=sn-pt-dashboard8481.8326.6236.70
Settings /wp-admin/admin.php?page=sn-pt-settings8841.7125.4941.45

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SN_PT_INIT::uninstall_plugin_data() should not be called statically
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sn-pt-settings
    • > Notice in wp-content/plugins/promotional-timer/includes/class.sn-pt-init.php+136
    Undefined variable: _SESSION
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sn-pt-settings
    • > Notice in wp-content/plugins/promotional-timer/includes/class.sn-pt-init.php+129
    Trying to access array offset on value of type null

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'SN_PT_INIT' not found in wp-content/plugins/promotional-timer/templates/setting/navigation.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention: You can take inspiration from this readme.txt

promotional-timer/init.php 92% from 13 tests

"Promotional Timer" version 1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("promotional-timer.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin1,589 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript5131250924
CSS2715369
PHP890138296

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity3.00
▷ Minimum class complexity2.00
▷ Maximum class complexity5.00
Average method complexity1.36
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods22
▷ Static methods418.18%
▷ Public methods2195.45%
▷ Protected methods00.00%
▷ Private methods14.55%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon.png0.82KB0.81KB▼ 1.31%