68% mode-analytics

Code Review | Mode Analytics

WordPress plugin Mode Analytics scored 68% from 54 tests.

About plugin

  • Plugin page: mode-analytics
  • Plugin version: 0.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.9
  • WordPress version: 6.3.1
  • First release: Mar 7, 2018
  • Latest release: Mar 7, 2018
  • Number of updates: 6
  • Update frequency: every 1.2 days
  • Top authors: danielbachhuber (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,553 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼1.24MB] [CPU: ▼41.06ms] Passed 4 tests

This is a short check of server-side resources used by Mode Analytics
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.73 ▼0.7314.02 ▼31.21
Dashboard /wp-admin2.77 ▼0.5321.78 ▼24.51
Posts /wp-admin/edit.php2.77 ▼0.5821.28 ▼27.44
Add New Post /wp-admin/post-new.php2.77 ▼3.1117.18 ▼81.09
Media Library /wp-admin/upload.php2.77 ▼0.4614.59 ▼20.34
Mode Analytics /wp-admin/options-general.php?page=mode-analytics2.7816.24

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Mode Analytics: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.62 ▼0.744.73 ▲2.8538.82 ▼7.27
Dashboard /wp-admin2,210 ▲225.85 ▼0.20106.93 ▼2.7441.30 ▼2.91
Posts /wp-admin/edit.php2,093 ▲42.06 ▲0.0540.95 ▼1.8634.87 ▼0.65
Add New Post /wp-admin/post-new.php1,531 ▲318.31 ▲0.09650.94 ▲17.2353.79 ▼9.65
Media Library /wp-admin/upload.php1,395 ▲74.16 ▼0.0196.59 ▼8.2142.44 ▼2.32
Mode Analytics /wp-admin/options-general.php?page=mode-analytics8411.8634.7028.48

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/mode-analytics/mode-analytics.php+39
    implode(): Passing glue string after array is deprecated. Swap the parameters
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

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)
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mode-analytics
    • > Deprecated in wp-content/plugins/mode-analytics/mode-analytics.php+39
    implode(): Passing glue string after array is deprecated. Swap the parameters
    • > GET request to /wp-admin/options-general.php?page=mode-analytics
    • > Notice in wp-content/plugins/mode-analytics/inc/class-settings.php+383
    Undefined index: show_filters
    • > GET request to /wp-admin/options-general.php?page=mode-analytics
    • > Notice in wp-content/plugins/mode-analytics/inc/class-settings.php+387
    Undefined index: show_export_csv

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
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mode-analytics/mode-analytics.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (From any report in Mode, turn on the White-Label Embed toggle.), #2 (Enter your Mode authentication credentials and the report's URL on the plugin's settings page.), #3 (Add a unique token to your report to dynamically change the content of the report based on who's viewing it.), #4 (Add embed to pages on your WordPress site using a short code.), #5 (View your White-Label Embed.)
The official readme.txt might help

mode-analytics/mode-analytics.php 92% from 13 tests

The main file in "Mode Analytics" v. 0.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Domain Path: The domain path folder does not exist ("/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
No dangerous file extensions were detected667 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP453201583
JavaScript21084

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity19.33
▷ Minimum class complexity3.00
▷ Maximum class complexity30.00
Average method complexity3.89
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods19
▷ Static methods19100.00%
▷ Public methods1052.63%
▷ Protected methods00.00%
▷ Private methods947.37%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants11
▷ Global constants00.00%
▷ Class constants11100.00%
▷ Public constants11100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 1.73MB with 1.23MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png367.27KB94.76KB▼ 74.20%
screenshot-3.png297.00KB82.44KB▼ 72.24%
screenshot-1.png405.77KB137.80KB▼ 66.04%
screenshot-4.png370.70KB111.42KB▼ 69.94%
screenshot-2.png335.35KB95.90KB▼ 71.40%