63% wp-central-posts-network

Code Review | WP Central Posts Network

WordPress plugin WP Central Posts Network scored63%from 54 tests.

About plugin

  • Plugin page: wp-central-posts-...
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.4
  • WordPress version: 6.3.1
  • First release: Apr 14, 2015
  • Latest release: Dec 28, 2015
  • Number of updates: 19
  • Update frequency: every 13.6 days
  • Top authors: nicholas_io (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,340 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼5.65ms] Passed 4 tests

An overview of server-side resources used by WP Central Posts Network
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0042.70 ▼2.55
Dashboard /wp-admin3.31 ▼0.0448.98 ▼18.47
Posts /wp-admin/edit.php3.36 ▲0.0049.07 ▼1.03
Add New Post /wp-admin/post-new.php5.89 ▲0.00104.66 ▼0.56
Media Library /wp-admin/upload.php3.23 ▲0.0038.12 ▼0.29

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 45 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Central Posts Network
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.72 ▲0.251.95 ▲0.2544.28 ▼0.31
Dashboard /wp-admin2,195 ▲185.61 ▲0.0585.83 ▼13.7839.94 ▼4.10
Posts /wp-admin/edit.php2,100 ▼01.95 ▼0.0036.22 ▼0.9434.04 ▼1.69
Add New Post /wp-admin/post-new.php1,526 ▼223.54 ▲0.42665.12 ▲28.0254.40 ▲5.50
Media Library /wp-admin/upload.php1,403 ▼04.12 ▼0.09107.61 ▲5.7245.61 ▲0.91

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Error in wp-content/plugins/wp-central-posts-network/uninstall.php+18
    Uncaught Error: Call to undefined function switch_to_blog() in wp-content/plugins/wp-central-posts-network/uninstall.php:18
    Stack trace:
    #0 wp-admin/includes/plugin.php(1245): include_once()
    #1 wp-admin/includes/plugin.php(960): uninstall_plugin()
  • The plugin did not uninstall correctly, leaving 45 files (0.64MB) in the plugin directory
    • (new file) LICENSE
    • (new file) README.txt
    • (new file) admin/assets/css/select2.png
    • (new file) README.md
    • (new file) admin/assets/css/admin.css
    • (new file) admin/assets/css/index.php
    • (new file) admin/assets/css/select2.min.css
    • (new file) admin/assets/css/select2-spinner.gif
    • (new file) LICENSE.txt
    • (new file) admin/assets/css/select2x2.png
    • ...
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
Please fix the following
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wp-central-posts-network/admin/views/admin-requests.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wp-central-posts-network/admin/views/post-selector/admin.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-central-posts-network/admin/views/post-selector/post-selector-section.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wp-central-posts-network/admin/views/admin-old-requests.php:2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-central-posts-network/admin/views/WP_List_Requests.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/wp-central-posts-network/admin/views/WP_List_Requests.php on line 4
    • > PHP Notice
      Undefined variable: section_slug in wp-content/plugins/wp-central-posts-network/admin/views/post-selector/post-selector-section.php on line 1
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-central-posts-network/admin/views/WP_List_Requests.php on line 4
    • > PHP Notice
      Undefined variable: blog_posts in wp-content/plugins/wp-central-posts-network/admin/views/post-selector/site-post-list.php on line 3
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wp-central-posts-network/admin/views/post-selector/site-post-list.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Choosing the posts for a given section.), #2 (The posts displaying on the main site), #3 (The code needed.)
The official readme.txt is a good inspiration

wp-central-posts-network/wpcpn.php 85% from 13 tests

The principal PHP file in "WP Central Posts Network" v. 1.0.6 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-central-posts-network.php" instead of "wpcpn.php")

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
Success! There were no dangerous files found in this plugin5,891 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript56454772,906
CSS2167881,711
PHP172874801,051
Markdown1430223

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity12.00
▷ Minimum class complexity2.00
▷ Maximum class complexity23.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods54
▷ Static methods2037.04%
▷ Public methods5092.59%
▷ Protected methods00.00%
▷ Private methods47.41%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants325.00%
▷ Class constants975.00%
▷ Public constants9100.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.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png18.08KB7.47KB▼ 58.68%
admin/assets/css/select2.png0.60KB0.99KB0.00%
screenshot-2.png186.60KB62.28KB▼ 66.62%
admin/assets/css/select2x2.png0.83KB0.77KB▼ 6.15%
screenshot-1.png55.08KB23.67KB▼ 57.03%