74% swiftpost

Code Review | SwiftPost

WordPress plugin SwiftPost scored74%from 54 tests.

About plugin

  • Plugin page: swiftpost
  • Plugin version: 0.5.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6.1
  • WordPress version: 6.3.1
  • First release: Sep 14, 2016
  • Latest release: Dec 1, 2016
  • Number of updates: 13
  • Update frequency: every 5.9 days
  • Top authors: ralva83702 (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

10+ active /1,122 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.33MB] [CPU: ▲0.05ms] 75% from 4 tests

A check of server-side resources used by SwiftPost
Please have a look at the following items
  • CPU: Try to keep total CPU usage under 500.00ms (currently 10,111.19ms on /wp-admin/admin.php?page=swiftpost)
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2143.63 ▲5.91
Dashboard /wp-admin3.67 ▲0.3648.00 ▼0.28
Posts /wp-admin/edit.php3.78 ▲0.4253.72 ▲4.76
Add New Post /wp-admin/post-new.php6.27 ▲0.3888.12 ▼5.45
Media Library /wp-admin/upload.php3.59 ▲0.3637.22 ▲1.16
Plugin Setup /wp-admin/admin.php?page=swiftpost-settings3.5649.93
Reports /wp-admin/admin.php?page=swiftpost-nativepost3.5634.65
Dashboard /wp-admin/admin.php?page=swiftpost3.5810,111.19
Split Testing /wp-admin/admin.php?page=swiftpost-abtest3.5634.74

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 42 new files
Database: 2 new tables, 8 new options
New tables
wp_swiftpost_abtest
wp_swiftpost_nativepost
New WordPress options
widget_recent-comments
swiftpost_config
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
swiftpost_license
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by SwiftPost
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,967 ▲23213.76 ▼0.825.05 ▲3.2041.70 ▼5.60
Dashboard /wp-admin2,261 ▲734.94 ▲0.0398.93 ▼15.1042.33 ▲0.37
Posts /wp-admin/edit.php2,144 ▲522.26 ▲0.3040.04 ▼1.1135.86 ▲1.04
Add New Post /wp-admin/post-new.php6,457 ▲4,94325.96 ▲8.45837.28 ▲140.2155.92 ▲4.13
Media Library /wp-admin/upload.php1,447 ▲624.54 ▲0.26100.50 ▼2.6343.51 ▲1.37
Plugin Setup /wp-admin/admin.php?page=swiftpost-settings1,0782.4530.8444.17
Reports /wp-admin/admin.php?page=swiftpost-nativepost9032.3027.8537.37
Dashboard /wp-admin/admin.php?page=swiftpost1,0162.3127.3732.19
Split Testing /wp-admin/admin.php?page=swiftpost-abtest9182.3027.4925.63

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie tables detected upon uninstall: 1 table
    • wp_swiftpost_abtest
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_ID() in wp-content/plugins/swiftpost/template/swiftpost-teaser.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Error' not found in wp-content/plugins/swiftpost/admin/wpfn-notifications.php:42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_ID() in wp-content/plugins/swiftpost/template/swiftpost-integrity.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_ID() in wp-content/plugins/swiftpost/template/swiftpost-teaser-sideimg.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_ID() in wp-content/plugins/swiftpost/template/swiftpost-icon.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_ID() in wp-content/plugins/swiftpost/template/swiftpost-renew.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/swiftpost/admin/swiftpost_admin_functions.php:180
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_ID() in wp-content/plugins/swiftpost/template/swiftpost-full.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/swiftpost/swiftpost.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_ID() in wp-content/plugins/swiftpost/template/swiftpost-ethos.php:1

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 Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: geo targeting, native advertising, frequency capping, sponsored content, advertising

swiftpost/swiftpost.php Passed 13 tests

This is the main PHP file of "SwiftPost" version 0.5.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
43 characters long description:
SwiftPost, native advertising for Wordpress

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
Everything looks great! No dangerous files found in this plugin3,992 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP144134891,870
CSS5127661,760
PO File14960184
JavaScript33620113
SVG30263
HTML1302

PHP code Passed 2 tests

A brief analysis 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.36
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity3.50
▷ Minimum method complexity2.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions40
▷ Named functions40100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 1.96MB with 0.51MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png168.29KB41.89KB▼ 75.11%
images/icon-menu-over.png0.48KB0.54KB0.00%
images/small-logo.png2.34KB2.04KB▼ 13.20%
images/logo.png5.46KB3.50KB▼ 35.97%
images/icon-menu.png0.78KB0.73KB▼ 6.61%