68% swiftype-custom-posts

Code Review | Swiftype Custom Posts

WordPress plugin Swiftype Custom Posts scored68%from 54 tests.

About plugin

  • Plugin page: swiftype-custom-p...
  • Plugin version: 0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.3.1
  • WordPress version: 6.3.1
  • First release: Oct 30, 2015
  • Latest release: Oct 30, 2015
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: svincoll4 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,495 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

An overview of server-side resources used by Swiftype Custom Posts
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0145.08 ▲7.97
Dashboard /wp-admin3.31 ▲0.0145.89 ▲1.43
Posts /wp-admin/edit.php3.36 ▲0.0146.82 ▼1.40
Add New Post /wp-admin/post-new.php5.89 ▲0.0189.45 ▼6.26
Media Library /wp-admin/upload.php3.24 ▲0.0134.22 ▲2.26
Swiftype Custom /wp-admin/options-general.php?page=swiftype-custom-posts3.2028.99

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 16 new files
Database: 2 new tables, 7 new options
New tables
wp_swifposts_custom_fields
wp_swifposts
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
swifpost_db_version
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Swiftype Custom Posts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲7213.12 ▼1.414.86 ▲2.4238.75 ▼3.58
Dashboard /wp-admin2,210 ▲185.85 ▲0.71112.46 ▲7.3942.81 ▼3.19
Posts /wp-admin/edit.php2,093 ▲42.03 ▲0.0539.63 ▼5.3637.42 ▼1.11
Add New Post /wp-admin/post-new.php1,550 ▲1318.86 ▲0.55613.18 ▲4.1470.37 ▲14.67
Media Library /wp-admin/upload.php1,395 ▲74.23 ▲0.0894.04 ▼5.8141.70 ▼1.13
Swiftype Custom /wp-admin/options-general.php?page=swiftype-custom-posts7522.0523.9424.14

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie tables detected upon uninstall: 2 tables
    • wp_swifposts
    • wp_swifposts_custom_fields
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • swifpost_db_version

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Almost there! Just fix the following items
  • 5× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/swiftype-custom-posts/swifposts-config.php
    • > /wp-content/plugins/swiftype-custom-posts/swifposts-install.php
    • > /wp-content/plugins/swiftype-custom-posts/swifposts.php
    • > /wp-content/plugins/swiftype-custom-posts/templates/ads.php
    • > /wp-content/plugins/swiftype-custom-posts/swifposts-loader.php
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'Swifposts_Config' not found in wp-content/plugins/swiftype-custom-posts/templates/credit.php:2
    • > PHP Notice
      Undefined index: id in wp-content/plugins/swiftype-custom-posts/templates/edit.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Swifposts_Loader' not found in wp-content/plugins/swiftype-custom-posts/templates/lists.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Swifposts_Loader' not found in wp-content/plugins/swiftype-custom-posts/templates/edit.php:6

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 93% from 29 tests

readme.txt Passed 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
8 plugin tags: custom search, better search, typeahead, suggest, autocomplete...

swiftype-custom-posts/swifposts.php 85% from 13 tests

The principal PHP file in "Swiftype Custom Posts" v. 0.3 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("swiftype-custom-posts.php" instead of "swifposts.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 158 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin706 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP816927672
Sass12018
CSS11115
HTML1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity30.67
▷ Minimum class complexity1.00
▷ Maximum class complexity87.00
Average method complexity4.18
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods28
▷ Static methods1242.86%
▷ Public methods28100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants333.33%
▷ Class constants666.67%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin