10% growth-hacking-analytics-by-qunb

Code Review | Growth Hacking Analytics by qunb.com

WordPress plugin Growth Hacking Analytics by qunb.com scored10%from 54 tests.

About plugin

  • Plugin page: growth-hacking-an...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.9.2
  • WordPress version: 6.3.1
  • First release: Jul 15, 2014
  • Latest release: Sep 1, 2014
  • Number of updates: 20
  • Update frequency: every 2.6 days
  • Top authors: jbtheard (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,449 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/growth-hacking-analytics-by-qunb/tools/src/Google/Utils.php+67
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼1.78MB] [CPU: ▼52.15ms] Passed 4 tests

A check of server-side resources used by Growth Hacking Analytics by qunb.com
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.21 ▼1.257.08 ▼36.92
Dashboard /wp-admin2.23 ▼1.078.17 ▼48.98
Posts /wp-admin/edit.php2.23 ▼1.1210.36 ▼38.26
Add New Post /wp-admin/post-new.php2.23 ▼3.667.80 ▼84.42
Media Library /wp-admin/upload.php2.23 ▼1.008.68 ▼25.49

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 168 new files
Database: no new tables, 21 new options
New WordPress options
qunb_twitter_followers
qunb_ga_web_property
db_upgraded
qunb_facebook_url
qunb_ga_token
can_compress_scripts
qunb_ghost_avg
qunb_ga_account
qunb_twitter_screen_name
qunb_ga_refresh_token
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Growth Hacking Analytics by qunb.com
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲10013.18 ▼1.071.93 ▼0.3536.87 ▼12.93
Dashboard /wp-admin2,214 ▲234.85 ▼1.02111.05 ▼8.5743.70 ▲0.97
Posts /wp-admin/edit.php2,097 ▲112.00 ▲0.0140.04 ▲3.8435.99 ▼2.27
Add New Post /wp-admin/post-new.php1,548 ▲2518.51 ▼4.80698.04 ▲38.1653.90 ▼8.48
Media Library /wp-admin/upload.php1,399 ▲84.18 ▼0.0295.26 ▼8.4540.25 ▼2.67
Growth Hacking Analytics /wp-admin/Growth_hacking_analytics.php260.440.1013.57

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/growth-hacking-analytics-by-qunb/tools/src/Google/Utils.php+67
    Array and string offset access syntax with curly braces is deprecated
  • Zombie WordPress options were found after uninstall: 21 options
    • qunb_ghost_avg_cumul
    • qunb_ga_web_property
    • qunb_ga_profile_timezone
    • widget_recent-posts
    • qunb_ga_token
    • can_compress_scripts
    • qunb_facebook_url
    • qunb_gp_emails
    • qunb_ga_profile_label
    • qunb_facebook_likes
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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
Please fix the following items
  • 8× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/growth-hacking-analytics-by-qunb/views/last_post.php
    • > /wp-content/plugins/growth-hacking-analytics-by-qunb/views/dashboard.php
    • > /wp-content/plugins/growth-hacking-analytics-by-qunb/views/top_posts.php
    • > /wp-content/plugins/growth-hacking-analytics-by-qunb/views/header.php
    • > /wp-content/plugins/growth-hacking-analytics-by-qunb/views/top_sources.php
    • > /wp-content/plugins/growth-hacking-analytics-by-qunb/views/change_mode.php
    • > /wp-content/plugins/growth-hacking-analytics-by-qunb/views/footer.php
    • > /wp-content/plugins/growth-hacking-analytics-by-qunb/views/growth_comparison.php
  • 146× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'Google/Http/Request.php' (include_path='.:/usr/share/php') in wp-content/plugins/growth-hacking-analytics-by-qunb/tools/src/Google/Http/CacheParser.php on line 18
    • > PHP Warning
      Use of undefined constant GROWTH_HACKING_ANALYTICS_URL - assumed 'GROWTH_HACKING_ANALYTICS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/growth-hacking-analytics-by-qunb/views/last_post.php on line 28
    • > PHP Fatal error
      require_once(): Failed opening required 'Google/Utils.php' (include_path='.:/usr/share/php') in wp-content/plugins/growth-hacking-analytics-by-qunb/tools/src/Google/Http/Request.php on line 18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service_qunb_analytics_v0_1_0' not found in wp-content/plugins/growth-hacking-analytics-by-qunb/tools/src/Google/Service/Pagespeedonline.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service_qunb_analytics_v0_1_0' not found in wp-content/plugins/growth-hacking-analytics-by-qunb/tools/src/Google/Service/Genomics.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service_qunb_analytics_v0_1_0' not found in wp-content/plugins/growth-hacking-analytics-by-qunb/tools/src/Google/Service/Bigquery.php:32
    • > PHP Fatal error
      require_once(): Failed opening required 'Google/Cache/Abstract.php' (include_path='.:/usr/share/php') in wp-content/plugins/growth-hacking-analytics-by-qunb/tools/src/Google/Cache/Memcache.php on line 18
    • > PHP Fatal error
      require_once(): Failed opening required 'Google/Client.php' (include_path='.:/usr/share/php') in wp-content/plugins/growth-hacking-analytics-by-qunb/tools/src/Google/Http/MediaFileUpload.php on line 18
    • > PHP Warning
      require_once(Google/Client.php): failed to open stream: No such file or directory in wp-content/plugins/growth-hacking-analytics-by-qunb/tools/src/Google/Http/MediaFileUpload.php on line 18
    • > PHP Warning
      require_once(Google/Auth/OAuth2.php): failed to open stream: No such file or directory in wp-content/plugins/growth-hacking-analytics-by-qunb/tools/src/Google/Auth/AssertionCredentials.php on line 18

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/Growth_hacking_analytics.php
    • > Network (severe)
    wp-admin/Growth_hacking_analytics.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
10 plugin tags: dashboard, tweets, google analytics, growth hacking, statistics...

growth-hacking-analytics-by-qunb/Growth_hacking_analytics.php 92% from 13 tests

The main PHP file in "Growth Hacking Analytics by qunb.com" 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: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("growth-hacking-analytics-by-qunb.php" instead of "Growth_hacking_analytics.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin109,191 lines of code in 144 files:
LanguageFilesBlank linesComment linesLines of code
PHP12118,36722,531109,161
JavaScript150022
CSS8008

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 120)
Cyclomatic complexity
Average complexity per logical line of code0.04
Average class complexity1.35
▷ Minimum class complexity1.00
▷ Maximum class complexity154.00
Average method complexity1.04
▷ Minimum method complexity1.00
▷ Maximum method complexity120.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1,956
▷ Abstract classes50.26%
▷ Concrete classes1,95199.74%
▷ Final classes00.00%
Methods15,848
▷ Static methods120.08%
▷ Public methods15,80899.75%
▷ Protected methods110.07%
▷ Private methods290.18%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants174
▷ Global constants52.87%
▷ Class constants16997.13%
▷ Public constants169100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
22 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/top-social-reddit-ico.png3.68KB2.16KB▼ 41.31%
images/post-details-twitter-ico.png1.56KB0.83KB▼ 46.59%
images/top-social-disqus-ico.png2.56KB1.35KB▼ 47.26%
images/qunb-logo.png4.42KB1.90KB▼ 57.06%
images/growth-ico.png2.60KB1.56KB▼ 39.94%