62% snap-marketing

Code Review | Snap Marketing

WordPress plugin Snap Marketing scored62%from 54 tests.

About plugin

  • Plugin page: snap-marketing
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.3
  • WordPress version: 6.3.1
  • First release: Jul 16, 2021
  • Latest release: Oct 27, 2023
  • Number of updates: 16
  • Update frequency: every 52.2 days
  • Top authors: snapfinance (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,244 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
Installer ran successfully

Server metrics [RAM: ▼1.71MB] [CPU: ▼0.37ms] 75% from 4 tests

An overview of server-side resources used by Snap Marketing
It is recommended to improve the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 523.59ms on /wp-admin/post-new.php?post_type=snap_treatments)
PageMemory (MB)CPU Time (ms)
Home /2.17 ▼1.298.08 ▼31.98
Dashboard /wp-admin2.34 ▼0.9773.77 ▲27.01
Posts /wp-admin/edit.php2.34 ▼1.0268.15 ▲21.97
Add New Post /wp-admin/post-new.php2.34 ▼3.5573.34 ▼18.49
Media Library /wp-admin/upload.php2.34 ▼0.8974.87 ▲40.90
Configuration /wp-admin/edit.php?post_type=snap_treatments&page=snap-marketing-configuration2.3473.88
All Treatments /wp-admin/edit.php?post_type=snap_treatments2.34111.71
Add New /wp-admin/post-new.php?post_type=snap_treatments2.34523.59

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 34 new files
Database: no new tables, 8 new options
New WordPress options
Snap_Product_Active
widget_theysaidso_widget
widget_recent-comments
default_snap_treatments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Snap Marketing
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,935 ▲17413.71 ▼0.658.97 ▲7.3668.98 ▲32.11
Dashboard /wp-admin2,229 ▲485.57 ▼0.1480.22 ▼17.9438.97 ▼8.48
Posts /wp-admin/edit.php2,131 ▲312.01 ▲0.0636.58 ▲0.7034.59 ▼0.93
Add New Post /wp-admin/post-new.php1,552 ▲2423.66 ▲0.59670.11 ▲53.8253.10 ▼3.64
Media Library /wp-admin/upload.php1,425 ▲284.18 ▼0.0195.71 ▼2.6443.39 ▼3.68
Configuration /wp-admin/edit.php?post_type=snap_treatments&page=snap-marketing-configuration9522.0725.6129.12
All Treatments /wp-admin/edit.php?post_type=snap_treatments1,8102.0236.1335.13
Add New /wp-admin/post-new.php?post_type=snap_treatments1,6002.6052.1564.27

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/snap-marketing/snap-marketing-admin-side.php+265
    simplexml_load_string(): Entity: line 4: parser error : Opening and ending tag mismatch: META line 2 and HEAD
  • This plugin does not fully uninstall, leaving 8 options in the database
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • Snap_Product_Active
    • default_snap_treatments
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=snap_treatments
    • > Warning in wp-content/plugins/snap-marketing/snap-marketing-admin-side.php+265
    simplexml_load_string(): Entity: line 4: parser error : Opening and ending tag mismatch: META line 2 and HEAD
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=snap_treatments
    • > Warning in wp-content/plugins/snap-marketing/snap-marketing-admin-side.php+265
    simplexml_load_string(): </HEAD><BODY>
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=snap_treatments
    • > Warning in wp-content/plugins/snap-marketing/snap-marketing-admin-side.php+265
    simplexml_load_string(): ^
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=snap_treatments
    • > Warning in wp-content/plugins/snap-marketing/snap-marketing-admin-side.php+265
    simplexml_load_string(): Entity: line 7: parser error : Specification mandates value for attribute noshade
  • 24 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=snap_treatments
    • > Warning in wp-content/plugins/snap-marketing/snap-marketing-admin-side.php+265
    simplexml_load_string(): <HR noshade size="1px">
  • 24 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=snap_treatments
    • > Warning in wp-content/plugins/snap-marketing/snap-marketing-admin-side.php+265
    simplexml_load_string(): ^
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=snap_treatments
    • > Warning in wp-content/plugins/snap-marketing/snap-marketing-admin-side.php+265
    simplexml_load_string(): Entity: line 7: parser error : attributes construct error
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=snap_treatments
    • > Warning in wp-content/plugins/snap-marketing/snap-marketing-admin-side.php+265
    simplexml_load_string(): Entity: line 7: parser error : Couldn't find end of Start Tag HR line 7
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=snap_treatments
    • > Warning in wp-content/plugins/snap-marketing/snap-marketing-admin-side.php+265
    simplexml_load_string(): Entity: line 13: parser error : Specification mandates value for attribute noshade
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=snap_treatments
    • > Warning in wp-content/plugins/snap-marketing/snap-marketing-admin-side.php+265
    simplexml_load_string(): Entity: line 13: parser error : attributes construct error
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=snap_treatments
    • > Warning in wp-content/plugins/snap-marketing/snap-marketing-admin-side.php+265
    simplexml_load_string(): Entity: line 13: parser error : Couldn't find end of Start Tag HR line 13
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=snap_treatments
    • > Warning in wp-content/plugins/snap-marketing/snap-marketing-admin-side.php+265
    simplexml_load_string(): Entity: line 20: parser error : Opening and ending tag mismatch: BR line 2 and BODY
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=snap_treatments
    • > Warning in wp-content/plugins/snap-marketing/snap-marketing-admin-side.php+265
    simplexml_load_string(): </BODY></HTML>
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=snap_treatments
    • > Warning in wp-content/plugins/snap-marketing/snap-marketing-admin-side.php+265
    simplexml_load_string(): Entity: line 20: parser error : Opening and ending tag mismatch: BR line 2 and HTML
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=snap_treatments
    • > Warning in wp-content/plugins/snap-marketing/snap-marketing-admin-side.php+265
    simplexml_load_string(): ^
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=snap_treatments
    • > Warning in wp-content/plugins/snap-marketing/snap-marketing-admin-side.php+265
    simplexml_load_string(): Entity: line 20: parser error : EndTag: '</' not found
  • 24 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=snap_treatments
    • > Notice in wp-includes/plugin.php+1004
    Undefined offset: 0

SRP 50% 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 take a closer look at the following
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_remote_get() in wp-content/plugins/snap-marketing/snap-marketing-admin-side.php:262
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_price_thousand_separator() in wp-content/plugins/snap-marketing/inc/snap-pre-qualification-as-low-as.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_price_thousand_separator() in wp-content/plugins/snap-marketing/inc/snap-get-approved-as-low-as.php:2
    • > PHP Warning
      constant(): Couldn't find constant Snap_Marketing_Logo_URL in wp-content/plugins/snap-marketing/snap-marketing-admin-side.php on line 261
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/snap-marketing/inc/snap-pre-qualification.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/snap-marketing/snap-marketing-front-side.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/snap-marketing/inc/snap-pre-approval.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/snap-marketing/inc/snap-banner.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/edit.php?post_type=snap_treatments
    • > Network (severe)
    https://snap-assets.snapfinance.com/en/us/marketing/aslowas/Dark.svg - Failed to load resource: the server responded with a status of 403 ()
    • > GET request to /wp-admin/edit.php?post_type=snap_treatments
    • > Network (severe)
    https://snap-assets.snapfinance.com/en/us/marketing/getapproved/Dark.svg - Failed to load resource: the server responded with a status of 403 ()

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4, #5, #6 in snap-marketing/assets to your readme.txt
Please take inspiration from this readme.txt

snap-marketing/snap-marketing.php 92% from 13 tests

The entry point to "Snap Marketing" version 1.0.5 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 214 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin1,723 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP81191341,091
CSS250314
JavaScript21620195
Markdown128091
SVG20132

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity48.50
▷ Minimum class complexity44.00
▷ Maximum class complexity53.00
Average method complexity4.80
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
11 PNG files occupy 1.63MB with 0.75MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/banner-772x250.png249.37KB91.09KB▼ 63.47%
assets/images/screenshot-1.png25.86KB9.35KB▼ 63.86%
assets/images/close_24px.png0.29KB0.23KB▼ 20.88%
assets/images/lock_24px.png0.33KB0.26KB▼ 20.90%
assets/images/screenshot-6.png208.90KB84.80KB▼ 59.41%