78% all-districts-news

Code Review | All Districts News

WordPress plugin All Districts News scored78%from 54 tests.

About plugin

  • Plugin page: all-districts-news
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 4, 2015
  • Latest release: Aug 14, 2015
  • Number of updates: 7
  • Update frequency: every 89.3 days
  • Top authors: emran.net (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,902 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

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

Analyzing server-side resources used by All Districts News
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.38 ▼11.24
Dashboard /wp-admin3.33 ▲0.0349.63 ▲0.14
Posts /wp-admin/edit.php3.38 ▲0.0353.69 ▼1.43
Add New Post /wp-admin/post-new.php5.91 ▲0.0384.75 ▼13.36
Media Library /wp-admin/upload.php3.25 ▲0.0234.64 ▲0.55
Districts Code /wp-admin/admin.php?page=districts-code3.7433.49
All Districts News /wp-admin/admin.php?page=all-districts-news3.2233.06
Installation /wp-admin/admin.php?page=installation3.2231.91

Server storage [IO: ▲0.39MB] [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: 12 new files
Database: no new tables, 7 new options
New WordPress options

Browser metrics Passed 4 tests

A check of browser resources used by All Districts News
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5814.34 ▼0.011.70 ▼0.2440.00 ▼4.13
Dashboard /wp-admin2,213 ▲365.56 ▼0.0386.46 ▼2.4964.58 ▲26.97
Posts /wp-admin/edit.php2,133 ▲331.98 ▼0.0141.41 ▲6.4735.34 ▼0.44
Add New Post /wp-admin/post-new.php1,551 ▲2323.57 ▲0.29737.71 ▲55.0157.79 ▼9.78
Media Library /wp-admin/upload.php1,433 ▲364.22 ▲0.0697.15 ▼16.2175.24 ▲28.96
Districts Code /wp-admin/admin.php?page=districts-code3,7392.0024.1654.26
All Districts News /wp-admin/admin.php?page=all-districts-news7862.0124.7625.81
Installation /wp-admin/admin.php?page=installation8591.9924.5226.18

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_all_districts_news
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% 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
The following issues need your attention
  • 5× PHP files output text when accessed directly:
    • > /wp-content/plugins/all-districts-news/menu-pages/districts-code.php
    • > /wp-content/plugins/all-districts-news/menu-pages/widget.php
    • > /wp-content/plugins/all-districts-news/menu-pages/all-districts-news.php
    • > /wp-content/plugins/all-districts-news/menu-pages/adn.php
    • > /wp-content/plugins/all-districts-news/index.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/all-districts-news/menu-pages/installation.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side


Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention: The official readme.txt is a good inspiration

all-districts-news/index.php 92% from 13 tests

"All Districts News" version 2.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("all-districts-news.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected2,175 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.00
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions583.33%
▷ Anonymous functions116.67%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.26MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
menu-pages/images/Installation1.png46.10KB21.85KB▼ 52.61%
menu-pages/images/Installation2.png77.71KB26.60KB▼ 65.77%
menu-pages/images/Installation4.png63.20KB19.37KB▼ 69.35%
menu-pages/images/Installation3.png81.22KB26.81KB▼ 66.99%
menu-pages/images/icon.png0.87KB0.87KB▼ 0.67%