10% wp-ads-within-contents

Code Review | WP Ads Within Contens

WordPress plugin WP Ads Within Contens scored10%from 54 tests.

About plugin

  • Plugin page: wp-ads-within-con...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.5
  • WordPress version: 6.3.1
  • First release: Jan 5, 2013
  • Latest release: Jan 5, 2013
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: sharpcoders (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active /6,440 total downloads

Benchmarks

Plugin footprint 40% 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
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/wp-ads-within-contents/wp-ads-within-contents.php+19
    Use of undefined constant WPAdsWithinContents - assumed 'WPAdsWithinContents' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.96MB] [CPU: ▼52.00ms] Passed 4 tests

This is a short check of server-side resources used by WP Ads Within Contens
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.23 ▼35.75
Dashboard /wp-admin2.05 ▼1.265.47 ▼42.16
Posts /wp-admin/edit.php2.05 ▼1.316.03 ▼38.88
Add New Post /wp-admin/post-new.php2.05 ▼3.845.54 ▼91.21
Media Library /wp-admin/upload.php2.05 ▼1.185.62 ▼27.57

Server storage [IO: ▲0.27MB] [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: 5 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
wp_ads_within_contents_options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Ads Within Contens
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6014.84 ▲0.461.70 ▼0.0545.40 ▲5.35
Dashboard /wp-admin2,210 ▲255.86 ▲0.01107.15 ▲10.5437.42 ▼8.51
Posts /wp-admin/edit.php2,096 ▲72.02 ▼0.0340.47 ▲2.6734.13 ▲3.24
Add New Post /wp-admin/post-new.php1,536 ▲323.14 ▲0.14672.92 ▲20.8957.29 ▲0.87
Media Library /wp-admin/upload.php1,392 ▲44.24 ▲0.04107.31 ▲13.3647.52 ▲5.91
Ads Within Contents /wp-admin/wp-ads-within-contents.php260.440.0712.77

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/wp-ads-within-contents/wp-ads-within-contents.php+19
    Use of undefined constant WPAdsWithinContents - assumed 'WPAdsWithinContents' (this will throw an Error in a future version of PHP)
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • wp_ads_within_contents_options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% 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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-ads-within-contents/wp-ads-within-contents.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: action_url in wp-content/plugins/wp-ads-within-contents/wp-ads-within-contents-admin-options.php on line 83
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/wp-ads-within-contents/wp-ads-within-contents-admin-options.php:85

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/wp-ads-within-contents.php
    • > Network (severe)
    wp-admin/wp-ads-within-contents.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Admin Panel Setting), #2 (WP Ads Within Contents)
You can take inspiration from this readme.txt

wp-ads-within-contents/wp-ads-within-contents.php 92% from 13 tests

The primary PHP file in "WP Ads Within Contens" version 1.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 145 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected364 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP21711364

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity3.57
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
2 PNG files occupy 0.25MB with 0.16MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png212.61KB84.16KB▼ 60.42%
screenshot-1.png47.35KB16.95KB▼ 64.21%