83% simple-analytics-tag-beta

Code Review | Simple Analytics Tag

WordPress plugin Simple Analytics Tag scored83%from 54 tests.

About plugin

  • Plugin page: simple-analytics-...
  • Plugin version: 1.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.5.1
  • WordPress version: 6.3.1
  • First release: Oct 25, 2019
  • Latest release: Oct 6, 2020
  • Number of updates: 11
  • Update frequency: every 31.6 days
  • Top authors: betacore (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,087 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.06MB] [CPU: ▼5.04ms] Passed 4 tests

This is a short check of server-side resources used by Simple Analytics Tag
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0541.16 ▲4.93
Dashboard /wp-admin3.37 ▲0.0644.63 ▼3.49
Posts /wp-admin/edit.php3.48 ▲0.1244.04 ▼1.16
Add New Post /wp-admin/post-new.php5.95 ▲0.0679.19 ▼11.74
Media Library /wp-admin/upload.php3.29 ▲0.0633.45 ▼3.78
Analytics Tag /wp-admin/options-general.php?page=bcSSAT_analytics3.2730.18

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Simple Analytics Tag
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.35 ▲0.081.91 ▲0.2543.87 ▲2.57
Dashboard /wp-admin2,202 ▲215.67 ▲0.0296.67 ▼1.5342.17 ▼1.42
Posts /wp-admin/edit.php2,101 ▲12.03 ▲0.0935.22 ▼2.5635.06 ▲0.89
Add New Post /wp-admin/post-new.php1,529 ▼623.21 ▲0.22591.29 ▼65.5659.76 ▲11.81
Media Library /wp-admin/upload.php1,407 ▲44.19 ▲0.0995.94 ▼10.4645.04 ▲0.41
Analytics Tag /wp-admin/options-general.php?page=bcSSAT_analytics8731.9922.1825.62

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/simple-analytics-tag-beta/templates/wp-admin-form.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-analytics-tag-beta/init/plugin.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-analytics-tag-beta/includes/analytics.function.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/simple-analytics-tag-beta/simple-analytics-tag.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-analytics-tag-beta/includes/wpadmin.function.php:54
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-analytics-tag-beta/includes/nav.function.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-analytics-tag-beta/includes/nav.function.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: Add an image for screenshot #1 (Add your UA or GTM code in the field. For GTM codes there are extra settings.)
  • Requires php: Version format is invalid
The official readme.txt might help

simple-analytics-tag-beta/simple-analytics-tag.php 77% from 13 tests

The main PHP script in "Simple Analytics Tag" version 1.4.1 is automatically included on every request by WordPress
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("simple-analytics-tag-beta.php" instead of "simple-analytics-tag.php")
  • Domain Path: The domain path folder does not exist ("/lang")

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
There were no executable files found in this plugin407 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP916474407

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity1.78
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods444.44%
▷ Protected methods555.56%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.21MB with 0.15MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png216.45KB58.39KB▼ 73.02%