83% snap-pixel

Code Review | Snap Pixel

WordPress plugin Snap Pixel scored 83% from 54 tests.

About plugin

  • Plugin page: snap-pixel
  • Plugin version: 1.5.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Sep 23, 2019
  • Latest release: Aug 16, 2023
  • Number of updates: 21
  • Update frequency: every 67.7 days
  • Top authors: creativehassan (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

800+ active / 9,631 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▼2.55ms] Passed 4 tests

Server-side resources used by Snap Pixel
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1036.08 ▼6.39
Dashboard /wp-admin3.39 ▲0.0951.12 ▲0.14
Posts /wp-admin/edit.php3.51 ▲0.1548.06 ▲0.54
Add New Post /wp-admin/post-new.php5.99 ▲0.1184.02 ▼4.50
Media Library /wp-admin/upload.php3.32 ▲0.0936.14 ▲5.11

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Snap Pixel
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,947 ▲19014.01 ▼0.365.17 ▲3.0441.37 ▼10.11
Dashboard /wp-admin2,247 ▲594.97 ▼0.91101.65 ▼19.7180.11 ▲37.41
Posts /wp-admin/edit.php2,127 ▲412.03 ▲0.0140.01 ▲4.5337.73 ▲3.08
Add New Post /wp-admin/post-new.php1,550 ▲823.22 ▲4.79687.07 ▲7.3558.34 ▲2.21
Media Library /wp-admin/upload.php1,426 ▲354.18 ▼0.04102.63 ▲2.4464.58 ▲22.32

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% 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 50% 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
The following issues need your attention
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/snap-pixel/admin/setting-tabs.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/snap-pixel/admin/snapchat_pixel_backend.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/snap-pixel/snapchat-pixel.php:257
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/snap-pixel/admin/snapchat_pixel_place_code.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Snap Pixel ID), #2 (Snap Pixel Settings), #3 (Snap Pixel WooCommerce Settings)
The official readme.txt is a good inspiration

snap-pixel/snapchat-pixel.php 77% from 13 tests

The primary PHP file in "Snap Pixel" version 1.5.7 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Description: The description should be shorter than 140 characters (currently 176 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("snap-pixel.php" instead of "snapchat-pixel.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin851 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP79770643
CSS2120181
JavaScript23027

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity42.50
▷ Minimum class complexity35.00
▷ Maximum class complexity50.00
Average method complexity4.46
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods24
▷ Static methods14.17%
▷ Public methods24100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/snapchat-pixel.png3.70KB1.04KB▼ 71.86%
assets/images/snapchat.png3.40KB0.68KB▼ 79.91%