84% foremedia-ads-inserter

Code Review | Foremedia Ads Inserter

WordPress plugin Foremedia Ads Inserter scored84%from 54 tests.

About plugin

  • Plugin page: foremedia-ads-ins...
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.9.2
  • WordPress version: 6.3.1
  • First release: Apr 7, 2022
  • Latest release: Oct 7, 2022
  • Number of updates: 29
  • Update frequency: every 6.4 days
  • Top authors: fgroupadsmanager (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /2,864 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.11MB] [CPU: ▲338.50ms] 75% from 4 tests

Analyzing server-side resources used by Foremedia Ads Inserter
Please take the time to fix the following items
  • Extra CPU: Extra CPU usage should be kept under 200.00ms (currently 338.50ms on /wp-admin/upload.php)
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1041.69 ▲0.05
Dashboard /wp-admin3.46 ▲0.16524.35 ▲480.30
Posts /wp-admin/edit.php3.51 ▲0.16491.15 ▲442.06
Add New Post /wp-admin/post-new.php5.98 ▲0.10528.02 ▲431.60
Media Library /wp-admin/upload.php3.32 ▲0.09527.20 ▲491.87

Server storage [IO: ▲0.03MB] [DB: ▲0.07MB] 67% from 3 tests

Filesystem and database footprint
Please try to fix the following items
  • You have illegally modified 1 file (0.72KB) outside of "wp-content/plugins/foremedia-ads-inserter/" and "wp-content/uploads/"
    • (new file) fmai_sw.js
Filesystem: 9 new files
Database: no new tables, 14 new options
New WordPress options
can_compress_scripts
widget_recent-comments
fmai_ads_txt
fmai_analytics_enabled
fmai_settings_updated
fmai_show_ads_txt_updated_notice
widget_recent-posts
db_upgraded
fmai_push_enabled
theysaidso_admin_options
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Foremedia Ads Inserter
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5813.24 ▼1.324.47 ▲2.6145.56 ▼5.33
Dashboard /wp-admin2,224 ▲394.87 ▼0.99107.29 ▲5.4541.35 ▼1.97
Posts /wp-admin/edit.php2,104 ▲152.04 ▼0.0237.61 ▲1.4934.51 ▼0.82
Add New Post /wp-admin/post-new.php1,547 ▲2523.26 ▲0.23650.57 ▼22.5649.85 ▼12.00
Media Library /wp-admin/upload.php1,406 ▲184.18 ▼0.0496.00 ▲2.5451.82 ▲6.14

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/foremedia-ads-inserter/templates/fmai_foremedia_ads_page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/foremedia-ads-inserter/includes/menu.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/foremedia-ads-inserter/includes/functions.php:45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/foremedia-ads-inserter/foremedia-ads-inserter.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/foremedia-ads-inserter/includes/ajax.php:115

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: foremedia platform, foreshop, foremedia, foremedia plugin, adstxt...

foremedia-ads-inserter/foremedia-ads-inserter.php Passed 13 tests

The main PHP file in "Foremedia Ads Inserter" ver. 1.1.0 adds more information about the plugin and also serves as the entry point for this plugin
75 characters long description:
This plugin allows you to integrate Foremedia Ads into your WordPress site.

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
Everything looks great! No dangerous files found in this plugin567 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP594174451
JavaScript230102
Markdown14014

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
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%
Functions21
▷ Named functions1990.48%
▷ Anonymous functions29.52%
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
No PNG files were detected