57% faster-with-stats

Code Review | Faster with Stats

WordPress plugin Faster with Stats scored57%from 54 tests.

About plugin

  • Plugin page: faster-with-stats
  • Plugin version: 1.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.0.3
  • WordPress version: 6.3.1
  • First release: May 18, 2015
  • Latest release: Jan 22, 2019
  • Number of updates: 80
  • Update frequency: every 16.8 days
  • Top authors: easycpmods (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /2,933 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.82MB] [CPU: ▼39.76ms] Passed 4 tests

A check of server-side resources used by Faster with Stats
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1138.43 ▲0.71
Dashboard /wp-admin3.13 ▼0.2125.44 ▼34.12
Posts /wp-admin/edit.php3.13 ▼0.2222.61 ▼29.55
Add New Post /wp-admin/post-new.php3.13 ▼2.7626.67 ▼79.58
Media Library /wp-admin/upload.php3.13 ▼0.1023.12 ▼15.80
Faster with Stats /wp-admin/options-general.php?page=ecpm_ddc_settings_page3.1326.18

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 44 new files
Database: 5 new tables, 14 new options
New tables
wp_ecpm_ddc
wp_ecpm_ddc_dead_users
wp_ecpm_ddc_total
wp_ecpm_ddc_speed
wp_ecpm_ddc_speed_total
New WordPress options
can_compress_scripts
ecpm_ddc_freq
ecpm_ddc_move_back_data
ecpm_ddc_leave_days
ecpm_ddc_db_ver
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
recovery_mode_email_last_sent
ecpm_ddc_remove_data
...

Browser metrics Passed 4 tests

Faster with Stats: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.22 ▼1.231.63 ▼0.0842.57 ▲1.64
Dashboard /wp-admin2,215 ▲274.88 ▼1.01104.38 ▲4.3143.13 ▲0.67
Posts /wp-admin/edit.php2,095 ▲32.00 ▼0.0433.93 ▼6.1635.17 ▼0.12
Add New Post /wp-admin/post-new.php1,534 ▲1523.10 ▼0.16647.32 ▼5.8450.69 ▼14.16
Media Library /wp-admin/upload.php1,391 ▲34.26 ▲0.01105.15 ▼7.8344.43 ▼3.91
Faster with Stats /wp-admin/options-general.php?page=ecpm_ddc_settings_page7291.536.7820.58

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/faster-with-stats/ecpm-ddc.php+40
    Use of undefined constant APP_TD - assumed 'APP_TD' (this will throw an Error in a future version of PHP)
  • Zombie tables detected upon uninstall: 5 tables
    • wp_ecpm_ddc_total
    • wp_ecpm_ddc_dead_users
    • wp_ecpm_ddc_speed
    • wp_ecpm_ddc
    • wp_ecpm_ddc_speed_total
  • The uninstall procedure has failed, leaving 14 options in the database
    • ecpm_ddc_record_threshold
    • recovery_mode_email_last_sent
    • ecpm_ddc_installed
    • widget_theysaidso_widget
    • ecpm_ddc_move_back_data
    • ecpm_ddc_db_ver
    • ecpm_ddc_leave_days
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=ecpm_ddc_settings_page
    • > Warning in wp-content/plugins/faster-with-stats/ecpm-ddc.php+40
    Use of undefined constant APP_TD - assumed 'APP_TD' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=ecpm_ddc_settings_page
    • > Error in wp-content/plugins/faster-with-stats/ddc-speed.php+28
    Uncaught Error: Call to undefined function appthemes_mysql_date() in wp-content/plugins/faster-with-stats/ddc-speed.php:28
    Stack trace:
    #0 wp-content/plugins/faster-with-stats/ddc-speed.php(6): ecpm_show_speed()
    #1 wp-content/plugins/faster-with-stats/ecpm-ddc.php(578): require_once('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(310): ecpm_ddc_settings_page_callback()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #7 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/faster-with-stats/ddc-speed.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/faster-with-stats/image_sidebar.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ddc_is_pro() in wp-content/plugins/faster-with-stats/ddc-posts.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/faster-with-stats/ecpm-ddc.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ddc_is_pro() in wp-content/plugins/faster-with-stats/ddc-hits.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/faster-with-stats/ddc-options.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ddc_is_pro() in wp-content/plugins/faster-with-stats/ddc-users.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Main functionality of the plugin - gained speed), #2 (Number of hits you are getting on your posts - PRO version), #3 (Statuses of posts - PRO version), #4 (Top users - PRO version), #5 (Options dialog)
You can take inspiration from this readme.txt

faster-with-stats/ecpm-ddc.php 77% from 13 tests

The main PHP file in "Faster with Stats" ver. 1.4.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 301 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("faster-with-stats.php" instead of "ecpm-ddc.php")

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
There were no executable files found in this plugin994 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP815940797
PO File16062152
CSS18045

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
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%
Functions26
▷ Named functions26100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
32 PNG files occupy 0.83MB with 0.37MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/cp-author-online.png5.43KB2.79KB▼ 48.73%
images/easycpmods-toolbox.png3.24KB3.44KB0.00%
images/pay-pal-paynow-button.png20.00KB6.87KB▼ 65.63%
images/screenshot-pro-ddc_users.png82.59KB34.13KB▼ 58.68%
screenshot-4.png90.94KB43.79KB▼ 51.85%