84% smartformat

Code Review | SmartFormat feed for SmartNews

WordPress plugin SmartFormat feed for SmartNews scored84%from 54 tests.

About plugin

  • Plugin page: smartformat
  • Plugin version: 1.3.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.26-6.1
  • WordPress version: 6.3.1
  • First release: Aug 20, 2019
  • Latest release: Nov 10, 2022
  • Number of updates: 21
  • Update frequency: every 56.8 days
  • Top authors: smartnewsdev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /11,980 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼6.77ms] Passed 4 tests

A check of server-side resources used by SmartFormat feed for SmartNews
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0639.59 ▼0.62
Dashboard /wp-admin3.38 ▲0.0743.52 ▼3.33
Posts /wp-admin/edit.php3.49 ▲0.1343.98 ▼1.24
Add New Post /wp-admin/post-new.php5.96 ▲0.0779.91 ▼21.07
Media Library /wp-admin/upload.php3.30 ▲0.0733.00 ▼1.44
SmartFormat /wp-admin/options-general.php?page=smartformat3.2935.87

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for SmartFormat feed for SmartNews
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.27 ▼1.101.70 ▼0.1043.70 ▲4.20
Dashboard /wp-admin2,210 ▲224.87 ▼1.04107.79 ▼12.0444.37 ▲0.17
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0434.40 ▼2.7532.12 ▲0.13
Add New Post /wp-admin/post-new.php1,536 ▲2223.27 ▲5.76635.80 ▼40.6058.86 ▲8.06
Media Library /wp-admin/upload.php1,392 ▲74.21 ▲0.0395.28 ▼0.7341.88 ▲0.64
SmartFormat /wp-admin/options-general.php?page=smartformat1,0393.1543.2430.16

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/smartformat/admin-logo-image.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/smartformat/admin.php:2
    • > PHP Warning
      Use of undefined constant SMARTFORMAT__PLUGIN_DIR - assumed 'SMARTFORMAT__PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/smartformat/class.smartformat.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/smartformat/smartformat.php:14
    • > PHP Fatal error
      require_once(): Failed opening required 'SMARTFORMAT__PLUGIN_DIR/class.smartformat-admin.php' (include_path='.:/usr/share/php') in wp-content/plugins/smartformat/class.smartformat.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function feed_content_type() in wp-content/plugins/smartformat/feed.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/smartformat/admin-sponsored-links.php:2
    • > PHP Warning
      require_once(SMARTFORMAT__PLUGIN_DIR/class.smartformat-admin.php): failed to open stream: No such file or directory in wp-content/plugins/smartformat/class.smartformat.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% 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
3 plugin tags: smartnews, rss, smartformat

smartformat/smartformat.php 92% from 13 tests

The main PHP file in "SmartFormat feed for SmartNews" ver. 1.3.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Domain Path: The domain path folder was not found ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin446 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP97245370
JavaScript221176

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity4.33
▷ Minimum class complexity2.00
▷ Maximum class complexity9.00
Average method complexity1.48
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods21
▷ Static methods14.76%
▷ Public methods2095.24%
▷ Protected methods00.00%
▷ Private methods14.76%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.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
No PNG files were detected