83% martins-analytics

Code Review | Martins Analytics

WordPress plugin Martins Analytics scored83%from 54 tests.

About plugin

  • Plugin page: martins-analytics
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0
  • WordPress version: 6.3.1
  • First release: Jun 18, 2022
  • Latest release: Jun 18, 2022
  • Number of updates: 9
  • Update frequency: every 0.1 days
  • Top authors: bundgaard (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /199 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
Installer ran successfully

Server metrics [RAM: ▼0.34MB] [CPU: ▼9.51ms] Passed 4 tests

Analyzing server-side resources used by Martins Analytics
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.405.18 ▼28.25
Dashboard /wp-admin3.33 ▼0.0149.67 ▼5.16
Posts /wp-admin/edit.php3.38 ▲0.0347.91 ▼0.70
Add New Post /wp-admin/post-new.php5.91 ▲0.0390.42 ▼3.92
Media Library /wp-admin/upload.php3.25 ▲0.0334.15 ▲1.08

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Martins Analytics
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲6613.29 ▼1.021.75 ▲0.2143.48 ▲2.46
Dashboard /wp-admin2,215 ▲265.90 ▲0.98107.94 ▼14.4242.00 ▼3.52
Posts /wp-admin/edit.php2,101 ▲122.02 ▲0.0139.07 ▲3.2335.85 ▲2.88
Add New Post /wp-admin/post-new.php1,552 ▲3318.09 ▼4.85603.84 ▼62.8152.20 ▲1.99
Media Library /wp-admin/upload.php1,394 ▲34.22 ▲0.0496.86 ▲1.2143.44 ▲0.24

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/martins-analytics/martinsAnalytics.php:148

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: pipeda, stats, ccpa, analytics, statistics...

martins-analytics/martinsAnalytics.php 69% from 13 tests

The entry point to "Martins Analytics" version 1.0.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Description: Keep the plugin description shorter than 140 characters (currently 254 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("martins-analytics.php" instead of "martinsAnalytics.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

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 plugin109 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12818109

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity5.50
▷ Minimum class complexity3.00
▷ Maximum class complexity8.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin