84% sync-post-with-other-site

Code Review | Sync Post With Other Site

WordPress plugin Sync Post With Other Site scored84%from 54 tests.

About plugin

  • Plugin page: sync-post-with-ot...
  • Plugin version: 1.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.3
  • WordPress version: 6.3.1
  • First release: Mar 2, 2020
  • Latest release: Sep 27, 2023
  • Number of updates: 27
  • Update frequency: every 48.7 days
  • Top authors: kp4coder (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

3,000+ active /18,234 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 gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼6.59ms] Passed 4 tests

An overview of server-side resources used by Sync Post With Other Site
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0638.55 ▼0.48
Dashboard /wp-admin3.37 ▲0.0747.35 ▼2.21
Posts /wp-admin/edit.php3.48 ▲0.1351.62 ▲1.85
Add New Post /wp-admin/post-new.php5.95 ▲0.0685.06 ▼18.81
Media Library /wp-admin/upload.php3.29 ▲0.0635.10 ▼4.86

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 17 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
sps_plugin
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
sps_version
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Sync Post With Other Site
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,886 ▲12513.41 ▼1.357.55 ▲5.5140.61 ▼6.31
Dashboard /wp-admin2,207 ▲335.65 ▲0.0493.45 ▲0.6241.05 ▲2.58
Posts /wp-admin/edit.php2,109 ▲92.04 ▲0.0439.90 ▲4.0237.54 ▲0.25
Add New Post /wp-admin/post-new.php6,268 ▲4,74226.00 ▲8.44949.41 ▲231.5056.66 ▲2.21
Media Library /wp-admin/upload.php1,412 ▲94.19 ▲0.05106.02 ▼3.0348.26 ▲0.19

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • sps_plugin
    • widget_recent-posts
    • db_upgraded
    • sps_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to a member function sps_get_settings_func() on null in wp-content/plugins/sync-post-with-other-site/includes/sps_settings.view.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sync-post-with-other-site/includes/sps_settings.class.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/sync-post-with-other-site/includes/sps_sync.class.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/sync-post-with-other-site/SyncPostWithOtherSite.php:65
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/sync-post-with-other-site/SyncPostWithOtherSite.php on line 43
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/sync-post-with-other-site/SyncPostWithOtherSite.php on line 34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sync-post-with-other-site/includes/sps_post_meta.class.php:8

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 93% 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
9 plugin tags: synchronization post, moving post data, post content, sync post content, post content sync...

sync-post-with-other-site/SyncPostWithOtherSite.php 85% from 13 tests

The main file in "Sync Post With Other Site" v. 1.4.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sync-post-with-other-site.php" instead of "SyncPostWithOtherSite.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin1,084 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP520461868
PO File162153158
JavaScript17330
CSS16028

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity34.25
▷ Minimum class complexity7.00
▷ Maximum class complexity104.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods37
▷ Static methods25.41%
▷ Public methods37100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants13100.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
3 PNG files occupy 0.11MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Setting page.PNG51.27KB26.18KB▼ 48.94%
SyncPostWithOtherSite.png11.71KB10.45KB▼ 10.73%
Post Add or Edit Select Website.PNG53.52KB24.28KB▼ 54.65%