78% wp-counter-up

Code Review | Counter Up - Animated Number Counter & Milestone Showcase

WordPress plugin Counter Up - Animated Number Counter & Milestone Showcase scored78%from 54 tests.

About plugin

  • Plugin page: wp-counter-up
  • Plugin version: 2.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.4.1
  • WordPress version: 6.3.1
  • First release: Jan 30, 2018
  • Latest release: Nov 15, 2023
  • Number of updates: 26
  • Update frequency: every 81.8 days
  • Top authors: LogicHunt (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active /19,023 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▼5.90ms] Passed 4 tests

Server-side resources used by Counter Up - Animated Number Counter & Milestone Showcase
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1034.46 ▼8.56
Dashboard /wp-admin3.42 ▲0.0750.00 ▼12.01
Posts /wp-admin/edit.php3.53 ▲0.1755.28 ▲13.22
Add New Post /wp-admin/post-new.php5.98 ▲0.0990.57 ▼3.57
Media Library /wp-admin/upload.php3.32 ▲0.0935.68 ▲0.53
All Item /wp-admin/edit.php?post_type=lgx_counter3.3939.34
Shortcode Generator /wp-admin/edit.php?post_type=lgx_wcu_generator3.3938.36
Add Item /wp-admin/post-new.php?post_type=lgx_counter3.5250.23
Usage & Help /wp-admin/edit.php?post_type=lgx_counter&page=lgx_counter_help_usage3.3640.37
Categories /wp-admin/edit-tags.php?taxonomy=lgxcountercat&post_type=lgx_counter3.4639.29

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 86 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Counter Up - Animated Number Counter & Milestone Showcase
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,996 ▲24914.63 ▲0.291.51 ▼0.2539.34 ▼4.64
Dashboard /wp-admin2,398 ▲2236.33 ▲0.71121.03 ▲1.7042.42 ▼4.87
Posts /wp-admin/edit.php2,323 ▲2233.48 ▲1.4760.33 ▲23.6034.54 ▼0.16
Add New Post /wp-admin/post-new.php1,736 ▲21022.57 ▲1.39628.42 ▼72.0531.33 ▼22.81
Media Library /wp-admin/upload.php1,460 ▲574.32 ▲0.1279.49 ▼21.2140.00 ▼2.46
All Item /wp-admin/edit.php?post_type=lgx_counter1,3223.6175.8328.82
Shortcode Generator /wp-admin/edit.php?post_type=lgx_wcu_generator1,3113.6852.5228.65
Add Item /wp-admin/post-new.php?post_type=lgx_counter1,8763.8470.4438.16
Usage & Help /wp-admin/edit.php?post_type=lgx_counter&page=lgx_counter_help_usage1,3503.2543.4091.06
Categories /wp-admin/edit-tags.php?taxonomy=lgxcountercat&post_type=lgx_counter1,5033.3945.0231.27

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-counter-up/admin/partials/shortcode_meta_display/__meta_section_get_pro.php
    • > /wp-content/plugins/wp-counter-up/admin/partials/wp-counter-up-admin-display.php
    • > /wp-content/plugins/wp-counter-up/public/partials/wp-counter-up-public-display.php
    • > /wp-content/plugins/wp-counter-up/admin/partials/shortcode_meta_display/__meta_section_help_block.php
  • 82× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-counter-up/public/partials/view-controller.php on line 71
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-counter-up/public/partials/view-controller.php on line 28
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/wp-counter-up/admin/partials/shortcode_meta_display/__meta_section_help_block.php on line 19
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-counter-up/public/partials/view-controller.php on line 54
    • > PHP Notice
      Undefined variable: lgx_generator_meta in wp-content/plugins/wp-counter-up/public/partials/view-controller.php on line 54
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-counter-up/public/partials/view-controller.php on line 63
    • > PHP Notice
      Undefined variable: lgx_generator_meta in wp-content/plugins/wp-counter-up/public/partials/view-controller.php on line 76
    • > PHP Warning
      Use of undefined constant LGX_WCU_PLUGIN_META_FIELD_PRO - assumed 'LGX_WCU_PLUGIN_META_FIELD_PRO' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-counter-up/admin/partials/shortcode_meta_display/__meta_section_get_pro.php on line 7
    • > PHP Notice
      Undefined variable: lgx_generator_meta in wp-content/plugins/wp-counter-up/public/partials/template/view-default.php on line 9
    • > PHP Notice
      Undefined variable: lgx_generator_meta in wp-content/plugins/wp-counter-up/public/partials/view-controller.php on line 73

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
You can take inspiration from this readme.txt

wp-counter-up/wp-counter-up.php Passed 13 tests

Analyzing the main PHP file in "Counter Up - Animated Number Counter & Milestone Showcase" version 2.2.1
96 characters long description:
This is a short description of what the plugin does. It's displayed in the WordPress admin area.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected8,731 lines of code in 61 files:
LanguageFilesBlank linesComment linesLines of code
PHP391,3511,2273,636
SVG1002,671
CSS87251,317
JavaScript123277061,106
HTML1001

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 106)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity45.89
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity4.97
▷ Minimum method complexity1.00
▷ Maximum method complexity106.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods97
▷ Static methods22.06%
▷ Public methods9193.81%
▷ Protected methods00.00%
▷ Private methods66.19%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/ls-logo.png0.97KB0.11KB▼ 88.59%
public/assets/img/prev.png1.32KB0.63KB▼ 52.22%
public/assets/img/prev-m.png1.27KB0.57KB▼ 55.08%
public/assets/img/next-m.png1.26KB0.57KB▼ 54.83%
admin/img/lgx-logo-metabox3.png3.80KB1.81KB▼ 52.46%