84% followprice

Code Review | Price Drop and In Stock Alert by Followprice

WordPress plugin Price Drop and In Stock Alert by Followprice scored84%from 54 tests.

About plugin

  • Plugin page: followprice
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.5.3
  • WordPress version: 6.3.1
  • First release: Aug 11, 2015
  • Latest release: Jul 20, 2016
  • Number of updates: 59
  • Update frequency: every 6.4 days
  • Top authors: danielmoreira (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /3,587 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.33ms] Passed 4 tests

This is a short check of server-side resources used by Price Drop and In Stock Alert by Followprice
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.23 ▼1.88
Dashboard /wp-admin3.34 ▲0.0449.56 ▼2.46
Posts /wp-admin/edit.php3.39 ▲0.0453.21 ▼2.11
Add New Post /wp-admin/post-new.php5.92 ▲0.0499.83 ▼6.77
Media Library /wp-admin/upload.php3.27 ▲0.0435.35 ▼1.99

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Price Drop and In Stock Alert by Followprice
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.30 ▼1.101.71 ▼0.1150.40 ▲6.71
Dashboard /wp-admin2,224 ▲244.85 ▼1.03104.27 ▼19.0039.15 ▼10.48
Posts /wp-admin/edit.php2,100 ▼32.01 ▲0.0440.14 ▼1.3435.66 ▼7.22
Add New Post /wp-admin/post-new.php1,548 ▲323.24 ▼0.01614.03 ▼63.2475.13 ▲7.62
Media Library /wp-admin/upload.php1,394 ▼34.26 ▲0.05101.65 ▼14.7147.41 ▼2.13

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_style() in wp-content/plugins/followprice/views/notice.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/followprice/views/dashboard.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_style() in wp-content/plugins/followprice/views/header.php:2

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 31 tag instead of maximum 10
The official readme.txt might help

followprice/followprice.php Passed 13 tests

This is the main PHP file of "Price Drop and In Stock Alert by Followprice" version 1.1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
94 characters long description:
Displays a button for customers to follow your products and get notified once the price drops.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin1,041 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP59979549
CSS1425273
JavaScript2213119
SVG202100

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.10MB with 0.07MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/dashboard-back.png97.94KB24.76KB▼ 74.72%