62% spr-posts-import

Code Review | SPR Posts Import

WordPress plugin SPR Posts Import scored62%from 54 tests.

About plugin

  • Plugin page: spr-posts-import
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.1
  • WordPress version: 6.3.1
  • First release: Apr 10, 2015
  • Latest release: Nov 8, 2016
  • Number of updates: 3
  • Update frequency: every 192.7 days
  • Top authors: sprise (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,430 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
Installer ran successfully

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

An overview of server-side resources used by SPR Posts Import
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0243.24 ▼1.02
Dashboard /wp-admin3.32 ▲0.0148.69 ▼2.85
Posts /wp-admin/edit.php3.43 ▲0.0744.67 ▼2.28
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.14 ▼19.37
Media Library /wp-admin/upload.php3.24 ▲0.0133.50 ▼5.28

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 91 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for SPR Posts Import
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.06 ▼0.231.66 ▼0.4645.33 ▲3.46
Dashboard /wp-admin2,196 ▲165.55 ▼0.1295.81 ▲5.8839.71 ▲2.20
Posts /wp-admin/edit.php2,104 ▲42.00 ▼0.0335.19 ▼3.6534.61 ▼1.55
Add New Post /wp-admin/post-new.php1,529 ▲323.78 ▲0.66655.54 ▼40.0453.30 ▼6.28
Media Library /wp-admin/upload.php1,398 ▲14.23 ▲0.07101.28 ▼10.5247.15 ▼2.87
SPR Posts Import /wp-admin/spr-posts-import.php260.420.0618.94

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 8× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/examples/xml-sequence-stream.php
    • > /wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/examples/read-into-dom.php
    • > /wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/examples/read-write.php
    • > /wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/examples/element-iterator.php
    • > /wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/examples/xpath.php
    • > /wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/examples/xml-file-scanner.php
    • > /wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/examples/xmlreader-standard.php
    • > /wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/build.php
  • 24× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'XMLAttributeFilterBase' not found in wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/src/XMLAttributeFilter.php:29
    • > PHP Fatal error
      Uncaught Error: Interface 'XMLReaderAggregate' not found in wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/src/XMLReaderNode.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/tests/unit/XMLElementIteratorTest.php:24
    • > PHP Notice
      Undefined offset: 0 in wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/build.php on line 110
    • > PHP Fatal error
      Uncaught Error: Interface 'XMLReaderAggregate' not found in wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/src/XMLAttributeIterator.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'XMLReaderFilterBase' not found in wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/src/XMLElementXpathFilter.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/tests/unit/XMLChildElementIteratorTest.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/tests/unit/XMLReaderElementTest.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'XMLElementIterator' not found in wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/src/XMLChildElementIterator.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/tests/unit/XMLReaderIteratorTest.php:24

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/spr-posts-import.php
    • > Network (severe)
    wp-admin/spr-posts-import.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === spr-posts-import === )
You can look at the official readme.txt

spr-posts-import/spr_posts_import.php 85% from 13 tests

Analyzing the main PHP file in "SPR Posts Import" version 1.1
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("spr-posts-import.php" instead of "spr_posts_import.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 146 characters long)

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
It is important to fix the following items
  • For security reasons, never distribute binary or executable files with your plugin
    • .out - Executable in Linux
      • wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/tests/functional/examples/Expectations/element-iterator_php.out
      • wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/tests/functional/examples/Expectations/read-into-dom_php.out
      • wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/tests/functional/examples/Expectations/read-write_php.out
      • wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/tests/functional/examples/Expectations/xml-file-scanner_php.out
      • wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/tests/functional/examples/Expectations/xml-sequence-stream_php.out
      • wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/tests/functional/examples/Expectations/xmlreader-standard_php.out
      • wp-content/plugins/spr-posts-import/vendor/hakre/xmlreaderiterator/tests/functional/examples/Expectations/xpath_php.out
5,110 lines of code in 76 files:
LanguageFilesBlank linesComment linesLines of code
PHP591,3572,4014,663
XML10213250
JSON34086
CSS119849
Markdown222036
JavaScript18826

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of 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.30
Average class complexity9.14
▷ Minimum class complexity1.00
▷ Maximum class complexity63.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces3
Interfaces2
Traits0
Classes63
▷ Abstract classes69.52%
▷ Concrete classes5790.48%
▷ Final classes23.51%
Methods399
▷ Static methods266.52%
▷ Public methods35288.22%
▷ Protected methods41.00%
▷ Private methods4310.78%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/hr_slashed_3-high.png3.58KB1.83KB▼ 48.99%
images/bg_lined.png4.05KB2.87KB▼ 29.03%
images/hr_slashed.png1.07KB0.31KB▼ 70.72%
images/sprite.png53.75KB17.06KB▼ 68.27%