84% newsmax-article-widget

Code Review | Newsmax InStream Ads

WordPress plugin Newsmax InStream Ads scored84%from 54 tests.

About plugin

  • Plugin page: newsmax-article-w...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7.2
  • WordPress version: 6.3.1
  • First release: Oct 21, 2015
  • Latest release: Feb 24, 2017
  • Number of updates: 14
  • Update frequency: every 35.6 days
  • Top authors: newsmax (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,070 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.59ms] Passed 4 tests

This is a short check of server-side resources used by Newsmax InStream Ads
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0146.38 ▼1.77
Dashboard /wp-admin3.32 ▲0.0247.60 ▼6.31
Posts /wp-admin/edit.php3.37 ▲0.0247.19 ▼4.46
Add New Post /wp-admin/post-new.php5.90 ▲0.0293.24 ▼5.82
Media Library /wp-admin/upload.php3.24 ▲0.0235.72 ▼0.43
Newsmax Instream Ads /wp-admin/options-general.php?page=newsmax-plugin-menu3.2133.33

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

Browser metrics Passed 4 tests

An overview of browser requirements for Newsmax InStream Ads
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.37 ▲0.011.87 ▲0.0043.57 ▼2.19
Dashboard /wp-admin2,199 ▲255.56 ▼0.0189.74 ▼16.5042.56 ▼1.94
Posts /wp-admin/edit.php2,104 ▲12.02 ▼0.0137.25 ▼1.3936.05 ▲0.90
Add New Post /wp-admin/post-new.php1,545 ▲1918.39 ▼4.56653.07 ▼26.9173.30 ▲19.24
Media Library /wp-admin/upload.php1,404 ▲44.19 ▲0.0296.80 ▼2.4343.87 ▼3.73
Newsmax Instream Ads /wp-admin/options-general.php?page=newsmax-plugin-menu8452.0024.1538.46

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/newsmax-article-widget/newsmax-in-article-widget-options-template.php:96
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/newsmax-article-widget/newsmax-in-article-widget.php:75

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (Activation screen in WP Admin.), #2 (Settings screenshot, to configure the widget.), #3 (How it would be displayed on your site.)
You can look at the official readme.txt

newsmax-article-widget/newsmax-in-article-widget.php 92% from 13 tests

The entry point to "Newsmax InStream Ads" version 1.1 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("newsmax-article-widget.php" instead of "newsmax-in-article-widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected170 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP22811170

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
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%
Functions7
▷ Named functions7100.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
4 PNG files occupy 0.25MB with 0.13MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png62.29KB23.04KB▼ 63.00%
logo.png6.32KB3.00KB▼ 52.45%
screenshot-1.png98.15KB46.07KB▼ 53.07%
screenshot-3.png84.22KB40.69KB▼ 51.69%