89% fomo

Code Review | Fomo for WooCommerce

WordPress plugin Fomo for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: fomo
  • Plugin version: 2.0.11
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.8
  • WordPress version: 6.3.1
  • First release: Aug 12, 2016
  • Latest release: Jul 28, 2021
  • Number of updates: 55
  • Update frequency: every 33.0 days
  • Top authors: fomo (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

40+ active /8,847 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼2.20ms] Passed 4 tests

Server-side resources used by Fomo for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0538.17 ▼1.71
Dashboard /wp-admin3.35 ▲0.0550.48 ▲4.57
Posts /wp-admin/edit.php3.40 ▲0.0551.20 ▲2.75
Add New Post /wp-admin/post-new.php5.93 ▲0.0586.12 ▼8.42
Media Library /wp-admin/upload.php3.27 ▲0.0532.92 ▼1.41

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Fomo for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲7614.74 ▲0.361.62 ▼0.3442.16 ▼0.01
Dashboard /wp-admin2,220 ▲354.84 ▼0.0699.79 ▼13.9041.34 ▲3.59
Posts /wp-admin/edit.php2,102 ▲132.06 ▲0.0340.68 ▲5.5534.39 ▼1.05
Add New Post /wp-admin/post-new.php1,525 ▲617.91 ▼5.44651.02 ▼37.8951.71 ▼1.33
Media Library /wp-admin/upload.php1,399 ▲114.21 ▼0.0396.59 ▼3.7141.77 ▼1.62

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

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Message & Basic settings for Fomo notifications shown on storefront.), #2 (Design & Settings page for Fomo advanced settings of notification shown on storefront.), #3 (Fomo Live shows how many notification are currently shown to your customers.), #4 (Example how Fomo notification looks on storefront.)
Please take inspiration from this readme.txt

fomo/woocommerce-plugin-fomo-v2.php 92% from 13 tests

The main PHP file in "Fomo for WooCommerce" ver. 2.0.11 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("fomo.php" instead of "woocommerce-plugin-fomo-v2.php")

Code Analysis 97% from 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 plugin10,305 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP101,7365,63410,252
CSS12053

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 104)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity239.88
▷ Minimum class complexity1.00
▷ Maximum class complexity562.00
Average method complexity7.71
▷ Minimum method complexity1.00
▷ Maximum method complexity104.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods285
▷ Static methods00.00%
▷ Public methods285100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants124
▷ Global constants124100.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
8 PNG files occupy 2.86MB with 1.82MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-7.png393.48KB139.68KB▼ 64.50%
screenshot-6.png282.48KB108.20KB▼ 61.70%
screenshot-3.png472.08KB164.51KB▼ 65.15%
screenshot-2.png169.96KB68.38KB▼ 59.77%
screenshot-5.png255.00KB84.14KB▼ 67.00%