79% ltk-google-analytics

Code Review | LTK Google Analytics

WordPress plugin LTK Google Analytics scored79%from 54 tests.

About plugin

  • Plugin page: ltk-google-analytics
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7.5
  • WordPress version: 6.3.1
  • First release: Jun 22, 2016
  • Latest release: Jun 22, 2016
  • Number of updates: 6
  • Update frequency: every 435.5 days
  • Top authors: oMega_2093 (66.67%)josejfernandez (50%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /620 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

Analyzing server-side resources used by LTK Google Analytics
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.38 ▼6.29
Dashboard /wp-admin3.33 ▼0.0248.60 ▼15.87
Posts /wp-admin/edit.php3.38 ▲0.0253.04 ▲5.55
Add New Post /wp-admin/post-new.php5.91 ▲0.0295.89 ▼2.50
Media Library /wp-admin/upload.php3.25 ▲0.0241.21 ▲3.91
Google Analytics /wp-admin/options-general.php?page=ltk-google-analytics3.2431.83

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for LTK Google Analytics
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5813.24 ▼1.301.59 ▼0.1440.54 ▼5.90
Dashboard /wp-admin2,228 ▲254.85 ▼1.0699.28 ▼4.4039.82 ▼1.61
Posts /wp-admin/edit.php2,104 ▲12.03 ▼0.0042.50 ▲4.0735.83 ▼0.88
Add New Post /wp-admin/post-new.php1,543 ▲1718.25 ▲0.52613.92 ▼74.6452.05 ▼5.20
Media Library /wp-admin/upload.php1,404 ▲44.35 ▲0.0297.35 ▼7.5643.01 ▼8.48
Google Analytics /wp-admin/options-general.php?page=ltk-google-analytics8162.0326.4929.70

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ltk-google-analytics/templates/analyticsjs.php
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/ltk-google-analytics/vendor/composer/autoload_real.php' (include_path='.:/usr/share/php') in wp-content/plugins/ltk-google-analytics/vendor/autoload.php on line 5
    • > PHP Warning
      require_once(wp-content/plugins/ltk-google-analytics/vendor/limitrek/lib-php/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/ltk-google-analytics/vendor/limitrek/lib-php/tests/init.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/ltk-google-analytics/vendor/limitrek/lib-php/vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/ltk-google-analytics/vendor/limitrek/lib-php/tests/init.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ltk-google-analytics/templates/admin/ltk-google-analytics.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/ltk-google-analytics/vendor/limitrek/lib-php/tests/unit/String/TransliteratorTest.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/ltk-google-analytics/ltk-google-analytics.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/ltk-google-analytics/vendor/limitrek/lib-php/tests/unit/String/UnicodeTest.php:5
    • > PHP Warning
      require_once(wp-content/plugins/ltk-google-analytics/vendor/composer/autoload_real.php): failed to open stream: No such file or directory in wp-content/plugins/ltk-google-analytics/vendor/autoload.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
3 plugin tags: statistics, google, analytics

ltk-google-analytics/ltk-google-analytics.php Passed 13 tests

The main PHP script in "LTK Google Analytics" version 1.0.0 is automatically included on every request by WordPress
79 characters long description:
Add the Google Analytics code to your website to get stats and track variables.

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
Everything looks great! No dangerous files found in this plugin748 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP14254247710
JSON10021
Markdown15011
XML1006

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity9.14
▷ Minimum class complexity1.00
▷ Maximum class complexity18.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods34
▷ Static methods38.82%
▷ Public methods2779.41%
▷ Protected methods617.65%
▷ Private methods12.94%
Functions6
▷ Named functions00.00%
▷ Anonymous functions6100.00%
Constants4
▷ Global constants4100.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
PNG images were not found in this plugin