71% coil-web-monetization

Code Review | Coil Web Monetization

WordPress plugin Coil Web Monetization scored 71% from 54 tests.

About plugin

  • Plugin page: coil-web-monetiza...
  • Plugin version: 1.9.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: May 19, 2020
  • Latest release: Jul 15, 2021
  • Number of updates: 15
  • Update frequency: every 38.8 days
  • Top authors: coil (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active / 2,798 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.37MB] [CPU: ▼312.95ms] Passed 4 tests

An overview of server-side resources used by Coil Web Monetization
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.97 ▲0.4565.27 ▲4.61
Dashboard /wp-admin3.82 ▲0.4138.89 ▼31.19
Posts /wp-admin/edit.php4.04 ▲0.4042.25 ▲0.41
Add New Post /wp-admin/post-new.php7.25 ▲0.27101.86 ▼1,220.40
Media Library /wp-admin/upload.php3.70 ▲0.4031.17 ▼0.60
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php4.4239.31

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 47 new files
Database: no new tables, 2 new options
New WordPress options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Coil Web Monetization
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,865 ▲11116.01 ▲0.415.90 ▼0.362.86 ▲0.05
Dashboard /wp-admin2,926 ▲726.10 ▼0.13124.82 ▼12.82182.18 ▲18.14
Posts /wp-admin/edit.php2,726 ▲393.24 ▼0.0064.01 ▼31.14147.04 ▼16.08
Add New Post /wp-admin/post-new.php1,764 ▲4519.41 ▼3.07460.77 ▲50.69199.04 ▲37.04
Media Library /wp-admin/upload.php1,734 ▲365.55 ▲0.05132.13 ▼18.03212.27 ▲24.04
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php5,60818.50560.62157.54

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure has failed, leaving 2 options in the database
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Notice in wp-content/plugins/coil-web-monetization/includes/functions.php+92
    Undefined index: post
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Notice in wp-content/plugins/coil-web-monetization/includes/functions.php+92
    Trying to get property 'post_type' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Notice in wp-includes/class-wp-customize-nav-menus.php+1152
    Trying to get property 'title' of non-object

SRP 0% 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
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/coil-web-monetization/templates/messages/split-content-message.php
    • > /wp-content/plugins/coil-web-monetization/templates/messages/banner-message.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/coil-web-monetization/templates/messages/subscriber-only-message.php:18

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, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Requires at least: Version format is invalid
  • Screenshots: These screenshots do not have images: #1 (Simple setup), #2 (Great support), #3 (Exclusive content)
The official readme.txt might help

coil-web-monetization/plugin.php 85% from 13 tests

The main PHP script in "Coil Web Monetization" version 1.9.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("coil-web-monetization.php" instead of "plugin.php")
  • Requires PHP: The required version number did not match the one declared in readme.txt ("7.1" instead of "7.2")

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
Good job! No executable or dangerous file extensions detected3,742 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PHP94266051,572
Sass912721773
JavaScript9132333653
CSS104321617
Markdown1490110
SVG30017

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
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
Namespaces5
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%
Functions78
▷ Named functions7494.87%
▷ Anonymous functions45.13%
Constants5
▷ Global constants00.00%
▷ Class constants5100.00%
▷ Public constants5100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 1.87MB with 1.24MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png551.03KB166.82KB▼ 69.73%
screenshot-3.png680.31KB227.78KB▼ 66.52%
screenshot-2.png633.19KB243.70KB▼ 61.51%
screenshot-4.png46.57KB15.07KB▼ 67.65%