77% newsplugin

Code Review | NewsPlugin

WordPress plugin NewsPlugin scored 77% from 54 tests.

About plugin

  • Plugin page: newsplugin
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.8
  • WordPress version: 6.3.1
  • First release: Apr 8, 2015
  • Latest release: Aug 25, 2021
  • Number of updates: 69
  • Update frequency: every 36.0 days
  • Top authors: newsplugin.com (92.75%)vyskoczilova (8.7%)

Code review

54 tests

User reviews

7 reviews

Install metrics

800+ active / 31,477 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.34MB] [CPU: ▲1.04ms] Passed 4 tests

Server-side resources used by NewsPlugin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3442.65 ▲2.45
Dashboard /wp-admin3.64 ▲0.3445.69 ▼3.93
Posts /wp-admin/edit.php3.75 ▲0.4049.98 ▲1.36
Add New Post /wp-admin/post-new.php6.24 ▲0.3597.28 ▲8.16
Media Library /wp-admin/upload.php3.56 ▲0.3437.37 ▲4.29

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 11 new options
New WordPress options
newsPlugin_system_info
widget_recent-comments
widget_recent-posts
news_plugin_version_taken
db_upgraded
news_plugin_version
widget_theysaidso_widget
news_plugin_url_method
widget_news_plugin_widget
can_compress_scripts
...

Browser metrics Passed 4 tests

A check of browser resources used by NewsPlugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲8913.31 ▼1.071.66 ▼0.1642.88 ▼0.54
Dashboard /wp-admin2,225 ▲344.91 ▼0.94102.27 ▼5.1540.71 ▼5.17
Posts /wp-admin/edit.php2,114 ▲282.05 ▲0.0441.60 ▲2.3635.95 ▼2.53
Add New Post /wp-admin/post-new.php1,533 ▼923.37 ▲4.87641.84 ▼9.5849.58 ▼8.42
Media Library /wp-admin/upload.php1,413 ▲224.24 ▲0.0497.50 ▲2.0640.41 ▼4.22

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_news_plugin_widget
    • widget_recent-comments
    • news_plugin_version
    • theysaidso_admin_options
    • news_plugin_url_method
    • widget_theysaidso_widget
    • news_plugin_version_taken

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/newsplugin/news-plugin.php
    • > /wp-content/plugins/newsplugin/news-plugin-widget.php
    • > /wp-content/plugins/newsplugin/news-plugin-utils.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/newsplugin/save_style.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/newsplugin/send_feedback.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% 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
7 plugin tags: news, newsfeed, newsfeeds, news plugin, news feed...

newsplugin/news-plugin.php 69% from 13 tests

"NewsPlugin" version 1.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("newsplugin.php" instead of "news-plugin.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Description: The description should be shorter than 140 characters (currently 268 characters long)
  • Domain Path: The domain path folder does not exist ("/languages")

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
Good job! No executable or dangerous file extensions detected3,488 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP52186351,995
JavaScript23271701,357
CSS210066
XML1142152
JSON10018

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity83.00
▷ Minimum class complexity57.00
▷ Maximum class complexity126.00
Average method complexity4.28
▷ Minimum method complexity1.00
▷ Maximum method complexity48.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods75
▷ Static methods1925.33%
▷ Public methods5370.67%
▷ Protected methods00.00%
▷ Private methods2229.33%
Functions2
▷ Named functions2100.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
There were not PNG files found in your plugin