78% easily-integrate-google-analytics

Code Review | Easily Integrate Google Analytics

WordPress plugin Easily Integrate Google Analytics scored78%from 54 tests.

About plugin

  • Plugin page: easily-integrate-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.4-4.5.1
  • WordPress version: 6.3.1
  • First release: May 13, 2016
  • Latest release: May 13, 2016
  • Number of updates: 4
  • Update frequency: every 1.5 days
  • Top authors: ccdsiu2 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /753 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
Install script ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼2.78ms] Passed 4 tests

A check of server-side resources used by Easily Integrate Google Analytics
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.39 ▼0.0825.03 ▼17.50
Dashboard /wp-admin3.31 ▲0.0151.58 ▼1.36
Posts /wp-admin/edit.php3.36 ▲0.0153.34 ▲3.18
Add New Post /wp-admin/post-new.php5.89 ▲0.0198.74 ▲6.58
Media Library /wp-admin/upload.php3.24 ▲0.0140.86 ▲4.57
Google Analytics /wp-admin/options-general.php?page=amk_ga_options3.1839.50

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Easily Integrate Google Analytics
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲3614.43 ▲0.1518.03 ▲16.1943.68 ▼0.00
Dashboard /wp-admin2,199 ▲245.62 ▲0.0190.79 ▼7.6240.13 ▲3.02
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0439.94 ▲3.4735.55 ▼2.53
Add New Post /wp-admin/post-new.php1,529 ▼023.23 ▲0.22682.40 ▼19.6052.53 ▼2.97
Media Library /wp-admin/upload.php1,401 ▲14.16 ▼0.10108.84 ▼5.1147.26 ▼0.99
Google Analytics /wp-admin/options-general.php?page=amk_ga_options8402.0028.0831.27

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=amk_ga_options
    • > Notice in wp-content/plugins/easily-integrate-google-analytics/options.php+25
    Trying to access array offset on value of type bool

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
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/easily-integrate-google-analytics/index.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easily-integrate-google-analytics/options.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% 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
6 plugin tags: insert, backend, google analytics, header, wp-head...

easily-integrate-google-analytics/index.php 92% from 13 tests

The main PHP file in "Easily Integrate Google Analytics" 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:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("easily-integrate-google-analytics.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin58 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP251858

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.00
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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