72% flying-analytics

Code Review | Flying Analytics

WordPress plugin Flying Analytics scored72%from 54 tests.

About plugin

  • Plugin page: flying-analytics
  • Plugin version: 1.2.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.3
  • WordPress version: 6.3.1
  • First release: Jan 1, 2020
  • Latest release: Aug 9, 2023
  • Number of updates: 61
  • Update frequency: every 21.6 days
  • Top authors: gijo (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

9,000+ active /44,857 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼7.43ms] Passed 4 tests

Analyzing server-side resources used by Flying Analytics
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0337.80 ▼1.25
Dashboard /wp-admin3.33 ▲0.0343.85 ▼4.77
Posts /wp-admin/edit.php3.39 ▲0.0342.22 ▼5.30
Add New Post /wp-admin/post-new.php5.92 ▲0.0379.72 ▼18.38
Media Library /wp-admin/upload.php3.26 ▲0.0337.31 ▼0.21
Flying Analytics /wp-admin/options-general.php?page=flying-analytics3.2329.36

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 424 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
widget_recent-comments
flying_analytics_disable_on_login
FLYING_ANALYTICS_VERSION
flying_analytics_method
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Flying Analytics: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲7614.35 ▼0.051.75 ▲0.1339.78 ▼0.07
Dashboard /wp-admin2,196 ▲165.54 ▼0.1086.12 ▲0.8340.04 ▼1.28
Posts /wp-admin/edit.php2,101 ▲11.98 ▼0.0136.78 ▼2.5932.49 ▼1.33
Add New Post /wp-admin/post-new.php1,529 ▲323.20 ▼0.12678.32 ▲22.9955.01 ▼5.19
Media Library /wp-admin/upload.php1,401 ▼24.20 ▲0.01109.25 ▲4.5746.54 ▲4.50
Flying Analytics /wp-admin/options-general.php?page=flying-analytics8852.0024.1126.02

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 9 options in the database
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • flying_analytics_method
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • flying_analytics_disable_on_login
    • FLYING_ANALYTICS_VERSION

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=flying-analytics
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

SRP 0% 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
Almost there! Just fix the following items
  • 5× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/flying-analytics/vendor/meta-box/meta-box/inc/templates/image-advanced.php
    • > /wp-content/plugins/flying-analytics/vendor/meta-box/meta-box/inc/templates/video.php
    • > /wp-content/plugins/flying-analytics/vendor/meta-box/meta-box/inc/templates/upload.php
    • > /wp-content/plugins/flying-analytics/vendor/meta-box/meta-box/inc/templates/audio.php
    • > /wp-content/plugins/flying-analytics/vendor/meta-box/meta-box/inc/templates/media.php
  • 175× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Input_Field' not found in wp-content/plugins/flying-analytics/vendor/meta-box/meta-box/inc/fields/fieldset-text.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/flying-analytics/vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/flying-analytics/vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Field' not found in wp-content/plugins/flying-analytics/vendor/meta-box/meta-box/inc/fields/button.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_File_Field' not found in wp-content/plugins/flying-analytics/vendor/meta-box/meta-box/inc/fields/media.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Select_Advanced_Field' not found in wp-content/plugins/flying-analytics/vendor/meta-box/meta-box/inc/fields/select-tree.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Input_List_Field' not found in wp-content/plugins/flying-analytics/vendor/meta-box/meta-box/inc/fields/checkbox-list.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Multiple_Values_Field' not found in wp-content/plugins/flying-analytics/vendor/meta-box/meta-box/inc/fields/text-list.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Media_Field' not found in wp-content/plugins/flying-analytics/vendor/meta-box/meta-box/inc/fields/video.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/flying-analytics/vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

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
3 plugin tags: minimal analytics, self host, google analytics

flying-analytics/index.php 92% from 13 tests

Analyzing the main PHP file in "Flying Analytics" version 1.2.2
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("flying-analytics.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin15,051 lines of code in 394 files:
LanguageFilesBlank linesComment linesLines of code
PHP2431,9214,9209,524
CSS411851292,604
JavaScript1055844942,526
JSON100196
Sass1159141
PO File2101755
SVG1005

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity5.18
▷ Minimum class complexity1.00
▷ Maximum class complexity61.00
Average method complexity2.34
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces1
Traits0
Classes208
▷ Abstract classes73.37%
▷ Concrete classes20196.63%
▷ Final classes00.00%
Methods659
▷ Static methods31547.80%
▷ Public methods54983.31%
▷ Protected methods7511.38%
▷ Private methods355.31%
Functions37
▷ Named functions2464.86%
▷ Anonymous functions1335.14%
Constants12
▷ Global constants866.67%
▷ Class constants433.33%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
14 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/meta-box/meta-box/img/jqueryui/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
vendor/meta-box/meta-box/img/jqueryui/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
vendor/meta-box/meta-box/img/jqueryui/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
vendor/meta-box/meta-box/img/jqueryui/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
vendor/meta-box/meta-box/img/jqueryui/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%