10% pg-simple-affiliate-shop

Code Review | PG Simple Affiliate Shop

WordPress plugin PG Simple Affiliate Shop scored 10% from 54 tests.

About plugin

  • Plugin page: pg-simple-affilia...
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.6.2
  • WordPress version: 6.3.1
  • First release: Aug 10, 2012
  • Latest release: Mar 24, 2021
  • Number of updates: 28
  • Update frequency: every 112.5 days
  • Top authors: peoplesgeek (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

200+ active / 37,006 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/pg-simple-affiliate-shop/inc/pg-options.php+28
    Methods with the same name as their class will not be constructors in a future version of PHP; PG_OptionsSupport has a deprecated constructor

Server metrics [RAM: ▲0.08MB] [CPU: ▲0.07ms] Passed 4 tests

A check of server-side resources used by PG Simple Affiliate Shop
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0644.05 ▲3.89
Dashboard /wp-admin3.39 ▲0.0847.05 ▼2.72
Posts /wp-admin/edit.php3.44 ▲0.0948.07 ▲0.30
Add New Post /wp-admin/post-new.php5.99 ▲0.1082.64 ▼1.17
Media Library /wp-admin/upload.php3.31 ▲0.0837.58 ▲3.88
Product Reorder /wp-admin/edit.php?post_type=pgeek_sas&page=pg-sas-reorder3.2731.27
All Products /wp-admin/edit.php?post_type=pgeek_sas3.3636.12
Add New Product /wp-admin/post-new.php?post_type=pgeek_sas3.4051.72
Product Type /wp-admin/edit-tags.php?taxonomy=pg_sas_type&post_type=pgeek_sas3.3238.19
Settings /wp-admin/edit.php?post_type=pgeek_sas&page=pg-sas3.2633.05

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 32 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
pg-sas-general-opt
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
pg_sas_type_children
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for PG Simple Affiliate Shop
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲4913.36 ▲0.161.63 ▼0.3843.70 ▲1.40
Dashboard /wp-admin2,227 ▲214.90 ▼0.97115.22 ▲1.8065.68 ▲20.72
Posts /wp-admin/edit.php2,143 ▲542.39 ▲0.3444.72 ▲10.9432.28 ▼2.77
Add New Post /wp-admin/post-new.php1,696 ▲18222.39 ▲5.00698.00 ▲42.5256.45 ▲2.24
Media Library /wp-admin/upload.php1,428 ▲404.33 ▲0.11104.79 ▼9.9646.06 ▼2.83
Product Reorder /wp-admin/edit.php?post_type=pgeek_sas&page=pg-sas-reorder8552.1437.9328.46
All Products /wp-admin/edit.php?post_type=pgeek_sas1,1982.2934.5834.01
Add New Product /wp-admin/post-new.php?post_type=pgeek_sas1,8593.7174.2887.34
Product Type /wp-admin/edit-tags.php?taxonomy=pg_sas_type&post_type=pgeek_sas1,5242.1730.9537.49
Settings /wp-admin/edit.php?post_type=pgeek_sas&page=pg-sas9632.1229.4532.39

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
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • pg_sas_type_children
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=pgeek_sas&page=pg-sas
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=pgeek_sas&page=pg-sas
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/pg-simple-affiliate-shop/shop.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/pg-simple-affiliate-shop/js/pg-sas-popup.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/pg-simple-affiliate-shop/inc/single-pgeek_sas.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (The 'Edit/New product' page), #2 (The 'All products' page), #3 (The shortcut in a standard page to create the shop), #4 (The shortcut in a text widget to create the banner), #5 (The resulting shop), #6 (The new shortcode helper/button in the editor)
The official readme.txt is a good inspiration

pg-simple-affiliate-shop/shop.php 85% from 13 tests

The entry point to "PG Simple Affiliate Shop" version 1.5 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("pg-simple-affiliate-shop.php" instead of "shop.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin1,537 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP52073151,031
CSS24025327
JavaScript54739179

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity62.50
▷ Minimum class complexity24.00
▷ Maximum class complexity101.00
Average method complexity3.24
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods55
▷ Static methods00.00%
▷ Public methods5294.55%
▷ Protected methods00.00%
▷ Private methods35.45%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
10 PNG files occupy 0.66MB with 0.23MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png71.59KB33.08KB▼ 53.79%
screenshot-6.png21.40KB9.87KB▼ 53.89%
images/cash-register-icon24.png1.17KB1.24KB0.00%
screenshot-3.png75.42KB33.42KB▼ 55.69%
images/clickhere.png5.21KB4.82KB▼ 7.45%