83% website-monetization-by-adswallow

Code Review | Website Monetization by AdSwallow

WordPress plugin Website Monetization by AdSwallow scored83%from 54 tests.

About plugin

  • Plugin page: website-monetizat...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.4.2
  • WordPress version: 6.3.1
  • First release: Feb 28, 2016
  • Latest release: Apr 12, 2016
  • Number of updates: 6
  • Update frequency: every 11.3 days
  • Top authors: adswallow (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,830 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

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

A check of server-side resources used by Website Monetization by AdSwallow
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0447.34 ▲6.64
Dashboard /wp-admin3.35 ▲0.0547.32 ▼3.06
Posts /wp-admin/edit.php3.47 ▲0.1149.25 ▼1.91
Add New Post /wp-admin/post-new.php5.93 ▲0.0597.00 ▲7.96
Media Library /wp-admin/upload.php3.28 ▲0.0537.63 ▲2.27
Website Monetization by AdSwallow /wp-admin/options-general.php?page=adsw_ad_group3.2433.19

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Website Monetization by AdSwallow
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,783 ▲2214.27 ▼0.081.62 ▼0.3037.59 ▼6.16
Dashboard /wp-admin2,202 ▲225.61 ▼0.0686.68 ▼8.9637.17 ▼5.27
Posts /wp-admin/edit.php2,107 ▲102.01 ▲0.0539.79 ▲1.9636.49 ▼0.09
Add New Post /wp-admin/post-new.php1,529 ▲323.53 ▲0.49696.65 ▲2.6663.00 ▼1.40
Media Library /wp-admin/upload.php1,404 ▲14.18 ▼0.00103.31 ▲1.4649.17 ▲0.22
Website Monetization by AdSwallow /wp-admin/options-general.php?page=adsw_ad_group9771.8529.0928.32

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

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)
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/website-monetization-by-adswallow/adsw.php:17

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)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
Please take inspiration from this readme.txt

website-monetization-by-adswallow/adsw.php 85% from 13 tests

The main file in "Website Monetization by AdSwallow" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 497 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("website-monetization-by-adswallow.php" instead of "adsw.php")

Code Analysis Passed 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
Everything looks great! No dangerous files found in this plugin1,399 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
CSS234531,204
PHP1318185
JavaScript10010

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity1.88
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods950.00%
▷ Protected methods00.00%
▷ Private methods950.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.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.04MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/resources/inspace.png15.30KB5.72KB▼ 62.61%
img/resources/whitespace.png30.36KB9.86KB▼ 67.52%