78% adfly-website-monetarization

Code Review | Adf.ly page monetarization

WordPress plugin Adf.ly page monetarization scored 78% 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: 5.9.2
  • 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,081 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.01MB] [CPU: ▼293.74ms] Passed 4 tests

Server-side resources used by Adf.ly page monetarization
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0252.32 ▲5.48
Dashboard /wp-admin3.46 ▲0.0234.37 ▲1.23
Posts /wp-admin/edit.php3.69 ▲0.0238.70 ▲1.48
Add New Post /wp-admin/post-new.php6.93 ▼0.0893.35 ▼1,177.37
Media Library /wp-admin/upload.php3.34 ▲0.0125.62 ▼0.30
Adfly /wp-admin/options-general.php?page=adflyi_settings_page3.2921.47

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 2 new options
New WordPress options
adfly_id
adfly_advert

Browser metrics Passed 4 tests

An overview of browser requirements for Adf.ly page monetarization
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,768 ▲1416.19 ▲0.205.83 ▼0.082.49 ▼0.54
Dashboard /wp-admin2,893 ▲356.17 ▼0.02115.60 ▼19.54159.16 ▼2.03
Posts /wp-admin/edit.php2,693 ▲23.24 ▼0.1364.47 ▼0.43141.98 ▼2.58
Add New Post /wp-admin/post-new.php1,693 ▲3520.65 ▲0.23420.66 ▼17.16155.92 ▼2.24
Media Library /wp-admin/upload.php1,703 ▲55.47 ▼0.02147.44 ▲1.28186.82 ▲5.05
Adfly /wp-admin/options-general.php?page=adflyi_settings_page8501.9737.0592.16

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
These items require your attention
  • The uninstall procedure has failed, leaving 2 options in the database
    • adfly_id
    • adfly_advert

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=adflyi_settings_page
    • > User deprecated in wp-includes/functions.php+5326
    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+5326
    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+1720
    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:1720
    Stack trace:
    #0 wp-content/plugins/adfly-website-monetarization/adfly-page.php(57): do_settings_fields()
    #1 wp-includes/class-wp-hook.php(307): adfly_menu_fn()
    #2 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(474): 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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > 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
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin 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 missing
The official readme.txt might help

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

Analyzing the main PHP file in "Adf.ly page monetarization" version 1.2
You should first fix the following items:
  • Main file name: The principal plugin file should be the same 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 programming languages used in this plugin; dangerous file extensions are not allowed
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

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
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

Often times overlooked, PNG files can occupy unnecessary space in 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%