10% adsense-for-authorsafa

Code Review | Adsense For Authors

WordPress plugin Adsense For Authors scored10%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: 6.3.1
  • 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,198 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/adsense-for-authorsafa/adsenseShare.php+149
    Undefined variable: user_id

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

Server-side resources used by Adsense For Authors
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0638.75 ▲0.69
Dashboard /wp-admin3.36 ▲0.0648.00 ▼0.75
Posts /wp-admin/edit.php3.47 ▲0.1242.82 ▼2.05
Add New Post /wp-admin/post-new.php5.94 ▲0.0581.19 ▼14.58
Media Library /wp-admin/upload.php3.28 ▲0.0532.21 ▼0.21

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 9 new options
New WordPress options
widget_afawidget
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
afa_option_name[adpub_id]
widget_recent-posts
afa_option_name[adposition]
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Adsense For Authors
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4414.53 ▲0.181.69 ▼0.1547.11 ▲6.63
Dashboard /wp-admin2,214 ▲335.62 ▼0.1182.56 ▼14.4536.11 ▼7.97
Posts /wp-admin/edit.php2,116 ▲161.99 ▲0.0433.88 ▼1.7335.31 ▼0.23
Add New Post /wp-admin/post-new.php1,541 ▲1523.15 ▲0.19691.51 ▲4.6458.37 ▲3.74
Media Library /wp-admin/upload.php1,419 ▲164.25 ▲0.0898.70 ▼0.0642.72 ▼5.31

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 9 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_afawidget
    • theysaidso_admin_options
    • afa_option_name[adpub_id]
    • widget_theysaidso_widget
    • widget_recent-comments
    • afa_option_name[adposition]

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)
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > 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 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: plugin, adense, wordpress, guest bloggers, revenue share...

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

The main file in "Adsense For Authors" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as 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
Everything looks great! 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

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.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

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected