57% wp-statistics-and-analytics

Code Review | WP Statistics and Analytics

WordPress plugin WP Statistics and Analytics scored57%from 54 tests.

About plugin

  • Plugin page: wp-statistics-and...
  • Plugin version: 0.0.3
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.9
  • WordPress version: 6.3.1
  • First release: Oct 12, 2017
  • Latest release: Dec 5, 2017
  • Number of updates: 7
  • Update frequency: every 7.9 days
  • Top authors: klickonit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /640 total downloads

Benchmarks

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

A check of server-side resources used by WP Statistics and Analytics
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1143.39 ▲1.16
Dashboard /wp-admin3.11 ▼0.1926.06 ▼30.85
Posts /wp-admin/edit.php3.12 ▼0.2429.41 ▼20.56
Add New Post /wp-admin/post-new.php3.11 ▼2.7728.72 ▼66.44
Media Library /wp-admin/upload.php3.11 ▼0.1125.56 ▼8.78
WP Statistics and Analytics /wp-admin/options-general.php?page=klick_sa3.1225.37

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for WP Statistics and Analytics
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,897 ▲15113.85 ▼0.529.05 ▲7.1941.94 ▼2.01
Dashboard /wp-admin2,219 ▲284.89 ▼1.0199.31 ▼7.4442.55 ▲5.08
Posts /wp-admin/edit.php2,099 ▲102.04 ▲0.0239.65 ▲3.5736.69 ▲2.17
Add New Post /wp-admin/post-new.php1,523 ▼1017.61 ▼5.70676.02 ▼23.5260.87 ▲2.44
Media Library /wp-admin/upload.php1,392 ▲44.28 ▲0.04100.79 ▼7.3249.23 ▲2.36
WP Statistics and Analytics /wp-admin/options-general.php?page=klick_sa1,4852.0324.6332.43

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
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 0% 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
    • > GET request to /wp-admin/options-general.php?page=klick_sa
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

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 fix the following
  • 14× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/wp-statistics-and-analytics/wp-statistics-and-analytics.php
    • > /wp-content/plugins/wp-statistics-and-analytics/includes/class-klick-sa-logger.php
    • > /wp-content/plugins/wp-statistics-and-analytics/includes/class-klick-sa-abstract-logger.php
    • > /wp-content/plugins/wp-statistics-and-analytics/templates/notices-templates/main-dashboard-notices.php
    • > /wp-content/plugins/wp-statistics-and-analytics/templates/klick-sa-tabs-header.php
    • > /wp-content/plugins/wp-statistics-and-analytics/includes/class-klick-sa-notifier.php
    • > /wp-content/plugins/wp-statistics-and-analytics/includes/class-klick-sa-commands.php
    • > /wp-content/plugins/wp-statistics-and-analytics/templates/klick-sa-tab-change-log.php
    • > /wp-content/plugins/wp-statistics-and-analytics/includes/class-klick-sa-email-logger.php
    • > /wp-content/plugins/wp-statistics-and-analytics/includes/class-klick-sa-options.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_count_posts() in wp-content/plugins/wp-statistics-and-analytics/templates/klick-sa-tab-information.php:13
    • > PHP Warning
      Use of undefined constant KLICK_SA_PLUGIN_URL - assumed 'KLICK_SA_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-statistics-and-analytics/templates/klick-sa-tab-our-other-plugins.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-statistics-and-analytics/templates/klick-sa-tab-our-other-plugins.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=klick_sa
    • > Network (severe)
    wp-content/plugins/wp-statistics-and-analytics//images/our-more-plugins/APV.svg - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=klick_sa
    • > Network (severe)
    wp-content/plugins/wp-statistics-and-analytics//images/our-more-plugins/ATS.svg - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: users, statics and analysis, post, short-code, page...

wp-statistics-and-analytics/wp-statistics-and-analytics.php 92% from 13 tests

The main PHP file in "WP Statistics and Analytics" ver. 0.0.3 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin1,777 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PHP19296485824
SVG11011521
CSS61511272
JavaScript42462113
Markdown127047

PHP code Passed 2 tests

A short review 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.34
Average class complexity8.67
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes216.67%
▷ Concrete classes1083.33%
▷ Final classes00.00%
Methods72
▷ Static methods56.94%
▷ Public methods7198.61%
▷ Protected methods00.00%
▷ Private methods11.39%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
6 PNG files occupy 0.15MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/notices/ual_notice_icon3.png30.17KB6.04KB▼ 79.98%
images/small_icon.png18.12KB0.45KB▼ 97.52%
images/notices/ual_notice_icon2.png9.63KB4.69KB▼ 51.23%
images/sa-banner.png65.28KB23.32KB▼ 64.28%
images/klick-on-it.png6.51KB4.02KB▼ 38.23%