10% news-from-surfrider-national

Code Review | News From Surfrider National

WordPress plugin News From Surfrider National scored10%from 54 tests.

About plugin

  • Plugin page: news-from-surfrid...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.6.1
  • WordPress version: 6.3.1
  • First release: Sep 30, 2013
  • Latest release: Sep 30, 2013
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: gwsuperfan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /889 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
Please fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/news-from-surfrider-national/newsfromsurfridernational.php+10
    Methods with the same name as their class will not be constructors in a future version of PHP; HQNewsWidget has a deprecated constructor

Server metrics [RAM: ▼1.94MB] [CPU: ▼56.62ms] Passed 4 tests

Server-side resources used by News From Surfrider National
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.414.69 ▼33.39
Dashboard /wp-admin2.08 ▼1.276.17 ▼57.93
Posts /wp-admin/edit.php2.08 ▼1.285.19 ▼40.53
Add New Post /wp-admin/post-new.php2.08 ▼3.816.85 ▼94.62
Media Library /wp-admin/upload.php2.08 ▼1.155.57 ▼29.03

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_hqnewswidget
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by News From Surfrider National
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.01 ▼0.351.98 ▲0.4844.52 ▲6.22
Dashboard /wp-admin2,189 ▲145.59 ▼0.0796.36 ▼2.4343.66 ▲1.33
Posts /wp-admin/edit.php2,100 ▲31.96 ▲0.0135.03 ▼1.1233.20 ▲0.88
Add New Post /wp-admin/post-new.php1,526 ▼223.61 ▲0.45700.82 ▲29.4045.97 ▼19.72
Media Library /wp-admin/upload.php1,400 ▲34.14 ▼0.11111.53 ▲9.9145.25 ▼2.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/news-from-surfrider-national/newsfromsurfridernational.php+10
    Methods with the same name as their class will not be constructors in a future version of PHP; HQNewsWidget has a deprecated constructor
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_hqnewswidget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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 take a closer look at the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to a member function find() on bool in wp-content/plugins/news-from-surfrider-national/hqnews.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/news-from-surfrider-national/newsfromsurfridernational.php:10
    • > PHP Warning
      file_get_contents(http://www.surfrider.org/pages/news-from-surfrider-national/): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found\r in wp-content/plugins/news-from-surfrider-national/simple_html_dom.php on line 75

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: syndication, widget, news

news-from-surfrider-national/newsfromsurfridernational.php 92% from 13 tests

The main PHP script in "News From Surfrider National" version 1.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("news-from-surfrider-national.php" instead of "newsfromsurfridernational.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected1,307 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP32042621,307

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity109.33
▷ Minimum class complexity1.00
▷ Maximum class complexity197.00
Average method complexity4.74
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods87
▷ Static methods11.15%
▷ Public methods7181.61%
▷ Protected methods1618.39%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants21
▷ Global constants21100.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
There are no PNG files in this plugin