79% sapphire-popups

Code Review | Sapphire Popups

WordPress plugin Sapphire Popups scored79%from 54 tests.

About plugin

  • Plugin page: sapphire-popups
  • Plugin version: 1.3.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 21, 2020
  • Latest release: Oct 2, 2020
  • Number of updates: 10
  • Update frequency: every 4.3 days
  • Top authors: bobbylee81 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /640 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼1.54ms] Passed 4 tests

This is a short check of server-side resources used by Sapphire Popups
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1043.62 ▼5.96
Dashboard /wp-admin3.41 ▲0.1156.07 ▲4.25
Posts /wp-admin/edit.php3.53 ▲0.1750.70 ▼3.67
Add New Post /wp-admin/post-new.php6.05 ▲0.1697.77 ▼0.34
Media Library /wp-admin/upload.php3.33 ▲0.1140.94 ▲3.81
Popups /wp-admin/edit.php?post_type=sapphire_popups3.3840.20
Settings /wp-admin/admin.php?page=sapphire-popups-settings3.3135.03

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Sapphire Popups
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6314.14 ▼0.131.71 ▼0.2543.33 ▼3.94
Dashboard /wp-admin2,227 ▲505.56 ▼0.0789.64 ▼12.3144.75 ▲0.77
Posts /wp-admin/edit.php2,132 ▲292.02 ▲0.0336.23 ▲1.4936.71 ▲1.93
Add New Post /wp-admin/post-new.php1,553 ▲2723.49 ▲0.37634.20 ▼19.6251.25 ▼2.91
Media Library /wp-admin/upload.php1,432 ▲354.17 ▼0.02111.38 ▲8.2045.45 ▲0.69
Popups /wp-admin/edit.php?post_type=sapphire_popups1,0931.9731.1528.61
Settings /wp-admin/admin.php?page=sapphire-popups-settings8702.0326.0730.94

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
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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 take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/sapphire-popups/admin/partials/sapphire-popups-admin-section-popups.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/sapphire-popups/admin/partials/sapphire-popups-admin-page.php:13

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)
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: classic editor, easy to use, popups, no cookies, gutenberg

sapphire-popups/sapphire-popups.php Passed 13 tests

The main file in "Sapphire Popups" v. 1.3.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
42 characters long description:
A simple yet powerful solution for popups.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin539 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP10264525328
JavaScript28166123
CSS28961
Markdown118026
SVG1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity5.20
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity1.70
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods30
▷ Static methods13.33%
▷ Public methods2583.33%
▷ Protected methods00.00%
▷ Private methods516.67%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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.07MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png31.52KB9.60KB▼ 69.54%
screenshot-1.png40.79KB12.30KB▼ 69.85%