10% simple-cron

Code Review | Simple Cron

WordPress plugin Simple Cron scored10%from 54 tests.

About plugin

  • Plugin page: simple-cron
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-3.5
  • WordPress version: 6.3.1
  • First release: Dec 3, 2012
  • Latest release: Dec 18, 2012
  • Number of updates: 8
  • Update frequency: every 2.0 days
  • Top authors: ChrisHurst (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active /2,877 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/simple-cron/plugin-admin.php+44
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.77MB] [CPU: ▼50.63ms] Passed 4 tests

Analyzing server-side resources used by Simple Cron
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.22 ▼1.247.03 ▼34.95
Dashboard /wp-admin2.24 ▼1.069.86 ▼41.00
Posts /wp-admin/edit.php2.24 ▼1.128.71 ▼40.59
Add New Post /wp-admin/post-new.php2.24 ▼3.659.67 ▼85.97
Media Library /wp-admin/upload.php2.24 ▼0.998.87 ▼32.38
Simple Cron /wp-admin/options-general.php?page=simple-cron/plugin-admin.php2.259.76

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Simple Cron
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.79 ▲0.391.72 ▼0.0851.43 ▲2.17
Dashboard /wp-admin2,210 ▲255.88 ▲1.01128.90 ▲12.2650.08 ▲2.98
Posts /wp-admin/edit.php2,096 ▲12.00 ▼0.0143.84 ▲6.6737.57 ▲3.64
Add New Post /wp-admin/post-new.php1,536 ▲321.07 ▼2.44775.25 ▲15.4959.44 ▲1.99
Media Library /wp-admin/upload.php1,392 ▲44.23 ▲0.05124.24 ▼141.7256.59 ▼25.11
Simple Cron /wp-admin/options-general.php?page=simple-cron/plugin-admin.php1,3444.88141.1945.15

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/simple-cron/plugin-admin.php+44
    Undefined index: enable_schedule_manager
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=simple-cron/plugin-admin.php
    • > Notice in wp-content/plugins/simple-cron/plugin-admin.php+420
    Undefined index: enable_schedule_manager
    • > GET request to /wp-admin/options-general.php?page=simple-cron/plugin-admin.php
    • > User deprecated in wp-includes/functions.php+5828
    Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.
    • > GET request to /wp-admin/options-general.php?page=simple-cron/plugin-admin.php
    • > Deprecated in wp-content/plugins/simple-cron/cron-schedule.class.php+34
    Non-static method Simple_Cron_Job_List::get_schedules() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=simple-cron/plugin-admin.php
    • > Deprecated in wp-content/plugins/simple-cron/cron-list.class.php+190
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=simple-cron/plugin-admin.php
    • > Deprecated in wp-content/plugins/simple-cron/plugin-admin.php+459
    Non-static method Simple_Cron_Job_List::add_cron_schedule_form() should not be called statically

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
Almost there! Just fix the following items
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/simple-cron/custom-cron-list-table.class.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/simple-cron/cron-schedule.class.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/simple-cron/cron-schedule.class.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/simple-cron/plugin-loader.php:11
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/simple-cron/cron-schedule.class.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Simple_Cron' not found in wp-content/plugins/simple-cron/plugin-admin.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/simple-cron/custom-cron-list-table.class.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/simple-cron/custom-cron-list-table.class.php on line 4

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=simple-cron/plugin-admin.php
    • > Network (severe)
    wp-content/plugins/simple-cron/style.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (Plugin Settings Page), #2 (Schedule Management Page)
The official readme.txt is a good inspiration

simple-cron/plugin-loader.php 92% from 13 tests

"Simple Cron" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("simple-cron.php" instead of "plugin-loader.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin702 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP6412156702

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity16.00
▷ Minimum class complexity7.00
▷ Maximum class complexity32.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods45
▷ Static methods00.00%
▷ Public methods3986.67%
▷ Protected methods12.22%
▷ Private methods511.11%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants1
▷ Global constants1100.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
There are no PNG files in this plugin