10% post-from-site

Code Review | Post From Site

WordPress plugin Post From Site scored10%from 54 tests.

About plugin

  • Plugin page: post-from-site
  • Plugin version: 3.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.3.1
  • WordPress version: 6.3.1
  • First release: Jun 5, 2009
  • Latest release: Jan 10, 2012
  • Number of updates: 48
  • Update frequency: every 19.8 days
  • Top authors: ryelle (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /39,558 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/post-from-site/pfs-widget.php+3
    Function create_function() is deprecated

Server metrics [RAM: ▼1.87MB] [CPU: ▼51.19ms] Passed 4 tests

An overview of server-side resources used by Post From Site
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.405.19 ▼33.29
Dashboard /wp-admin2.16 ▼1.156.25 ▼40.08
Posts /wp-admin/edit.php2.16 ▼1.206.30 ▼40.93
Add New Post /wp-admin/post-new.php2.16 ▼3.735.16 ▼90.47
Media Library /wp-admin/upload.php2.16 ▼1.075.46 ▼28.22
Post From Site /wp-admin/options-general.php?page=pfs2.165.33

Server storage [IO: ▲0.08MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
can_compress_scripts
pfs_options
widget_pfswidget
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Post From Site
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,893 ▲12213.53 ▼0.8210.43 ▲8.5540.29 ▲0.29
Dashboard /wp-admin2,202 ▲255.60 ▲0.0186.21 ▼2.6038.09 ▼6.63
Posts /wp-admin/edit.php2,104 ▲12.02 ▲0.0338.03 ▼2.5034.04 ▼3.43
Add New Post /wp-admin/post-new.php1,538 ▼1118.25 ▼0.15621.76 ▼1.9668.89 ▼10.52
Media Library /wp-admin/upload.php1,404 ▲44.25 ▲0.0695.88 ▼10.3143.00 ▼3.05
Post From Site /wp-admin/options-general.php?page=pfs9902.0424.5330.67

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/post-from-site/pfs-widget.php+3
    Function create_function() is deprecated
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-comments
    • widget_recent-posts
    • pfs_options
    • theysaidso_admin_options
    • widget_pfswidget
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=pfs
    • > Deprecated in wp-content/plugins/post-from-site/pfs-widget.php+3
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=pfs
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in PfsWidget is deprecated since version 4.3.0! Use __construct() instead.

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
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/post-from-site/pfs-submit.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/admin.php' (include_path='.:/usr/share/php') in wp-content/plugins/post-from-site/post-from-site.class.php on line 20
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/post-from-site/post-from-site.class.php on line 20
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/admin.php): failed to open stream: No such file or directory in wp-content/plugins/post-from-site/post-from-site.class.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/post-from-site/pfs-widget.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === post-from-site === )
  • Screenshots: Please add an image for screenshot #1 (Post From Site in action (default 'twentyeleven' theme): inserted onto a sticky post using the shortcode.)
The official readme.txt might help

post-from-site/post-from-site.class.php 92% from 13 tests

"Post From Site" version 3.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("post-from-site.php" instead of "post-from-site.class.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
Everything looks great! No dangerous files found in this plugin889 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP4112231689
CSS2527160
JavaScript201140

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity19.00
▷ Minimum class complexity1.00
▷ Maximum class complexity49.00
Average method complexity2.86
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png23.06KB7.84KB▼ 66.01%