84% wp-yearendstats

Code Review | WP Year End Stats

WordPress plugin WP Year End Stats scored84%from 54 tests.

About plugin

  • Plugin page: wp-yearendstats
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0-4.1
  • WordPress version: 6.3.1
  • First release: Jun 8, 2008
  • Latest release: Dec 29, 2014
  • Number of updates: 24
  • Update frequency: every 104.8 days
  • Top authors: sudar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,040 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼6.23ms] Passed 4 tests

A check of server-side resources used by WP Year End Stats
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0739.87 ▲0.13
Dashboard /wp-admin3.38 ▲0.0745.69 ▼3.60
Posts /wp-admin/edit.php3.49 ▲0.1343.56 ▼4.44
Add New Post /wp-admin/post-new.php5.96 ▲0.0781.31 ▼15.23
Media Library /wp-admin/upload.php3.30 ▲0.0733.96 ▼1.66
Year End Stats /wp-admin/index.php?page=year-end-stats3.2731.26

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

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

Browser metrics Passed 4 tests

WP Year End Stats: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,874 ▲11313.93 ▼0.498.52 ▲6.9443.19 ▲1.01
Dashboard /wp-admin2,199 ▲215.59 ▼0.0592.05 ▼9.1140.60 ▼1.45
Posts /wp-admin/edit.php2,107 ▲101.98 ▲0.0440.61 ▲4.6334.19 ▼0.52
Add New Post /wp-admin/post-new.php1,531 ▲523.03 ▲0.08643.92 ▼44.3553.85 ▼0.52
Media Library /wp-admin/upload.php1,401 ▼24.20 ▲0.0197.39 ▼1.5944.91 ▼1.75
Year End Stats /wp-admin/index.php?page=year-end-stats8272.0323.6826.61

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% 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
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SM\\YearEndStats\\Shortcode\\add_shortcode() in wp-content/plugins/wp-yearendstats/includes/shortcode.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-yearendstats/wp-yearendstats.php:47

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: stats, comments, posts

wp-yearendstats/wp-yearendstats.php 85% from 13 tests

The main PHP file in "WP Year End Stats" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Domain Path: The domain path must begin with a forward slash character ("/languages/")
  • Domain Path: The domain path should use only dashes and lowercase characters ("languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin2,638 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript25294062,241
PHP359147397

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity16.00
▷ Minimum class complexity14.00
▷ Maximum class complexity18.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods1254.55%
▷ Protected methods1045.45%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin