88% wpteam-google-adsense

Code Review | WPteam Google Adsense

WordPress plugin WPteam Google Adsense scored 88% from 54 tests.

About plugin

  • Plugin page: wpteam-google-ads...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.9.5
  • WordPress version: 5.8.1
  • First release: Apr 17, 2018
  • Latest release: Apr 20, 2018
  • Number of updates: 7
  • Update frequency: every 0.6 days
  • Top authors: wpteamkr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 365 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.18MB] [CPU: ▼141.90ms] Passed 4 tests

An overview of server-side resources used by WPteam Google Adsense
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.99 ▲0.1638.56 ▲3.33
Dashboard /wp-admin3.30 ▲0.2449.96 ▲2.95
Posts /wp-admin/edit.php3.35 ▲0.2446.27 ▼0.86
Add New Post /wp-admin/post-new.php5.59 ▲0.1690.09 ▼572.56
Media Library /wp-admin/upload.php3.18 ▲0.1835.19 ▲2.87

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 28 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

WPteam Google Adsense: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,843 ▲24716.32 ▲0.7211.35 ▲1.1350.04 ▲0.37
Dashboard /wp-admin3,001 ▲676.06 ▼0.01145.65 ▲2.90112.78 ▲4.15
Posts /wp-admin/edit.php2,770 ▲312.69 ▲0.0065.40 ▼25.0385.83 ▼22.15
Add New Post /wp-admin/post-new.php1,698 ▲1518.81 ▲1.70387.66 ▲31.95113.43 ▲4.85
Media Library /wp-admin/upload.php1,835 ▲255.01 ▼0.01152.23 ▼4.49120.53 ▲2.16

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstall script ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wpteam-google-adsense/public/partials/wpteam-ggadsense-public-display.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wpteam-google-adsense/admin/partials/wpteam-ggadsense-admin-display.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention: Please take inspiration from this readme.txt

wpteam-google-adsense/wpteam-ggadsense.php 85% from 13 tests

Analyzing the main PHP file in "WPteam Google Adsense" version 1.0.0
Please make the necessary changes and fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wpteam-google-adsense.php" instead of "wpteam-ggadsense.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected736 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP13148672497
PO File141145107
JSON10082
CSS23848
JavaScript1001
Markdown1101

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity8.71
▷ Minimum class complexity1.00
▷ Maximum class complexity32.00
Average method complexity2.35
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods40
▷ Static methods25.00%
▷ Public methods3587.50%
▷ Protected methods00.00%
▷ Private methods512.50%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
2 PNG files occupy 0.14MB with 0.09MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/description_00.png64.78KB24.07KB▼ 62.85%
admin/img/description_01.png75.95KB28.47KB▼ 62.51%