10% adsense-for-authorsafa

Code Review | Adsense For Authors

WordPress plugin Adsense For Authors scored 10% from 54 tests.

About plugin

  • Plugin page: adsense-for-autho...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.2.2
  • WordPress version: 5.9.2
  • First release: May 21, 2015
  • Latest release: May 21, 2015
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: obscurant1st (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,000 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/adsense-for-authorsafa/adsenseShare.php+149
    Undefined variable: user_id

Server metrics [RAM: ▲0.03MB] [CPU: ▼292.65ms] Passed 4 tests

An overview of server-side resources used by Adsense For Authors
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.0869.90 ▲11.74
Dashboard /wp-admin3.47 ▲0.0633.85 ▼1.35
Posts /wp-admin/edit.php3.70 ▲0.0639.32 ▼3.97
Add New Post /wp-admin/post-new.php6.94 ▼0.0489.77 ▼1,155.56
Media Library /wp-admin/upload.php3.35 ▲0.0523.88 ▼9.70

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 3 new options
New WordPress options
afa_option_name[adpub_id]
afa_option_name[adposition]
widget_afawidget

Browser metrics Passed 4 tests

An overview of browser requirements for Adsense For Authors
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,803 ▲5915.88 ▼0.076.26 ▲0.552.10 ▼0.58
Dashboard /wp-admin2,912 ▲516.13 ▼0.03124.06 ▼60.48254.98 ▲70.59
Posts /wp-admin/edit.php2,708 ▲233.24 ▼0.0063.94 ▼0.62144.94 ▼77.55
Add New Post /wp-admin/post-new.php1,674 ▼7816.61 ▼4.53413.80 ▼60.02177.69 ▲18.90
Media Library /wp-admin/upload.php1,712 ▲175.56 ▲0.07135.07 ▼8.16264.78 ▲75.67

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 3 options in the database
    • afa_option_name[adposition]
    • widget_afawidget
    • afa_option_name[adpub_id]

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/adsense-for-authorsafa/adsenseShare.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/adsense-for-authorsafa/widgetad.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: plugin, wordpress revenue share, free revenue share, revenue share, wordpress plugin...

adsense-for-authorsafa/adsenseShare.php 92% from 13 tests

The main PHP file in "Adsense For Authors" ver. 1.0 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: Please rename the main PHP file in this plugin to the plugin slug ("adsense-for-authorsafa.php" instead of "adsenseShare.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin240 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2145179
CSS15061

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin