73% pixel-for-web-stories

Code Review | Pixel & tracking codes for Google Web stories (formerly AMP Stories)

WordPress plugin Pixel & tracking codes for Google Web stories (formerly AMP Stories) scored73%from 54 tests.

About plugin

  • Plugin page: pixel-for-web-sto...
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-6.3
  • WordPress version: 6.3.1
  • First release: Oct 22, 2020
  • Latest release: Aug 24, 2023
  • Number of updates: 17
  • Update frequency: every 61.0 days
  • Top authors: pagup (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,313 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲5.42MB] [CPU: ▲21.51ms] 75% from 4 tests

This is a short check of server-side resources used by Pixel & tracking codes for Google Web stories (formerly AMP Stories)
It is recommended to improve the following
  • Extra RAM: Extra memory usage should kept under 5MB (currently 5.42MB on /wp-admin/options-general.php?page=pixel-for-web-stories)
PageMemory (MB)CPU Time (ms)
Home /9.26 ▲5.7970.31 ▲25.43
Dashboard /wp-admin9.28 ▲5.9776.33 ▲21.56
Posts /wp-admin/edit.php9.28 ▲5.9280.09 ▲21.19
Add New Post /wp-admin/post-new.php9.88 ▲3.98125.78 ▲17.85
Media Library /wp-admin/upload.php9.28 ▲6.0580.51 ▲42.41
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2863.95
Pixel for Web Stories /wp-admin/options-general.php?page=pixel-for-web-stories9.2868.40

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 210 new files
Database: no new tables, 9 new options
New WordPress options
fs_debug_mode
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
fs_accounts
fs_active_plugins
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Pixel & tracking codes for Google Web stories (formerly AMP Stories)
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5914.35 ▼0.061.82 ▼0.2639.55 ▼10.14
Dashboard /wp-admin2,223 ▲435.74 ▲0.1690.50 ▼4.8555.27 ▲16.74
Posts /wp-admin/edit.php2,132 ▲292.01 ▲0.0738.34 ▼0.8454.17 ▲19.04
Add New Post /wp-admin/post-new.php1,544 ▲1623.33 ▲0.16719.15 ▲93.1664.87 ▲10.58
Media Library /wp-admin/upload.php1,431 ▲374.12 ▼0.08114.72 ▲9.0864.76 ▲19.20
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0961.7126.3441.84
Pixel for Web Stories /wp-admin/options-general.php?page=pixel-for-web-stories1,0291.6827.8877.14

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/pixel-for-web-stories/vendor/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 9 options in the database
    • fs_active_plugins
    • widget_theysaidso_widget
    • fs_debug_mode
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • fs_accounts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 take a closer look at the following
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/pixel-for-web-stories/admin/views/inc/side.view.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Pagup\\Pixel\\Core\\Plugin' not found in wp-content/plugins/pixel-for-web-stories/admin/views/faq.view.php:46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Pagup\\Pixel\\Controllers\\add_action() in wp-content/plugins/pixel-for-web-stories/admin/controllers/TrackingController.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/pixel-for-web-stories/admin/views/notices/webstories.view.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Pagup\\Pixel\\add_action() in wp-content/plugins/pixel-for-web-stories/admin/Settings.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses() in wp-content/plugins/pixel-for-web-stories/admin/views/notices/support.view.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses() in wp-content/plugins/pixel-for-web-stories/admin/views/notices/pro.view.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/pixel-for-web-stories/admin/views/settings.view.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'Pagup\\Pixel\\Core\\Plugin' not found in wp-content/plugins/pixel-for-web-stories/admin/controllers/NotificationController.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: Screenshot #2 (Pixel for Web Stories Settings Page) image required
You can look at the official readme.txt

pixel-for-web-stories/pixel-for-web-stories.php 85% from 13 tests

The principal PHP file in "Pixel & tracking codes for Google Web stories (formerly AMP Stories)" v. 1.0.5 is loaded by WordPress automatically on each request
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 207 characters long)
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin35,020 lines of code in 164 files:
LanguageFilesBlank linesComment linesLines of code
PHP1428,28817,55434,563
CSS15286226
JavaScript54462222
JSON2009

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity74.72
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.48
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes61
▷ Abstract classes23.28%
▷ Concrete classes5996.72%
▷ Final classes00.00%
Methods1,323
▷ Static methods21916.55%
▷ Public methods92569.92%
▷ Protected methods251.89%
▷ Private methods37328.19%
Functions104
▷ Named functions10298.08%
▷ Anonymous functions21.92%
Constants146
▷ Global constants9967.81%
▷ Class constants4732.19%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
vendor/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
vendor/freemius/assets/img/pixel-for-web-stories.png22.25KB5.13KB▼ 76.94%
vendor/freemius/assets/img/bulk-image-title-attribute.png21.19KB7.20KB▼ 66.04%