78% adfly-website-monetarization

Code Review | Adf.ly page monetarization

WordPress plugin Adf.ly page monetarization scored78%from 54 tests.

About plugin

  • Plugin page: adfly-website-mon...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4
  • WordPress version: 6.3.1
  • First release: Aug 29, 2013
  • Latest release: Nov 19, 2015
  • Number of updates: 7
  • Update frequency: every 116.9 days
  • Top authors: carli2 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /6,279 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.60ms] Passed 4 tests

Server-side resources used by Adf.ly page monetarization
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.84 ▼3.77
Dashboard /wp-admin3.32 ▲0.0249.66 ▼1.04
Posts /wp-admin/edit.php3.37 ▲0.0250.32 ▼1.83
Add New Post /wp-admin/post-new.php5.90 ▲0.0197.02 ▼3.74
Media Library /wp-admin/upload.php3.24 ▲0.0138.19 ▲3.14
Adfly /wp-admin/options-general.php?page=adflyi_settings_page3.1931.96

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 8 new options
New WordPress options
adfly_advert
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
adfly_id

Browser metrics Passed 4 tests

Checking browser requirements for Adf.ly page monetarization
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.07 ▼0.291.85 ▼0.0046.10 ▲0.42
Dashboard /wp-admin2,202 ▲225.58 ▼0.0691.76 ▼0.0637.84 ▼5.52
Posts /wp-admin/edit.php2,101 ▲11.96 ▼0.0534.73 ▼1.7136.31 ▼0.38
Add New Post /wp-admin/post-new.php1,531 ▲523.21 ▼0.02621.21 ▼42.3862.25 ▲7.65
Media Library /wp-admin/upload.php1,401 ▲14.13 ▼0.08104.88 ▲3.8743.34 ▼1.41
Adfly /wp-admin/options-general.php?page=adflyi_settings_page6971.516.5317.71

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
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • adfly_advert
    • can_compress_scripts
    • db_upgraded
    • adfly_id

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=adflyi_settings_page
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=adflyi_settings_page
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=adflyi_settings_page
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/adfly-website-monetarization/adfly-page.php on line 57 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/adfly-website-monetarization/adfly-page.php(57): do_settings_fields()
    #1 wp-includes/class-wp-hook.php(310): adfly_menu_fn()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #6 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_option() in wp-content/plugins/adfly-website-monetarization/adfly-page.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Plugin Name: Please specify the plugin name on the first line ( === adfly-website-monetarization === )
  • Screenshots: Screenshot #1 (Visit adf.ly at http://adf.ly/?id=3757920 to register. You need a registration in order to monetarize your site.) image not found
Please take inspiration from this readme.txt

adfly-website-monetarization/adfly-page.php 92% from 13 tests

The main PHP file in "Adf.ly page monetarization" ver. 1.2 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("adfly-website-monetarization.php" instead of "adfly-page.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin59 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP191159

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.19
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.09MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png87.83KB38.43KB▼ 56.24%