78% pinterest-importer

Code Review | Pinterest Importer

WordPress plugin Pinterest Importer scored78%from 54 tests.

About plugin

  • Plugin page: pinterest-importer
  • Plugin version: 0.7.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.2.1
  • WordPress version: 6.3.1
  • First release: Apr 24, 2014
  • Latest release: Jun 4, 2019
  • Number of updates: 61
  • Update frequency: every 30.6 days
  • Top authors: grosbouff (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

60+ active /9,583 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
Install script ran successfully

Server metrics [RAM: ▲0.68MB] [CPU: ▲6.80ms] Passed 4 tests

An overview of server-side resources used by Pinterest Importer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1950.02 ▲9.46
Dashboard /wp-admin4.19 ▲0.8955.13 ▲6.40
Posts /wp-admin/edit.php4.24 ▲0.8859.44 ▲5.75
Add New Post /wp-admin/post-new.php6.71 ▲0.82102.73 ▲5.58
Media Library /wp-admin/upload.php4.05 ▲0.8248.53 ▲13.00
Add New /wp-admin/post-new.php?post_type=pin4.1550.23
Pending importation /wp-admin/edit.php?post_type=pin&page=pending-importation4.0641.94
Pins /wp-admin/edit.php?post_type=pin4.1337.23
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=pin4.1746.17
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=pin4.1737.66
Settings /wp-admin/edit.php?post_type=pin&page=settings4.0038.68
Pinterest Account /wp-admin/edit.php?post_type=pin&page=account4.0037.09
Pinterest Boards /wp-admin/edit.php?post_type=pin&page=boards4.0641.78

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 150 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
widget_recent-comments
_pinterest-importer-db_version
category_children
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Pinterest Importer: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲8214.72 ▼0.001.91 ▲0.1544.49 ▲0.73
Dashboard /wp-admin2,246 ▲785.64 ▲0.0797.60 ▲5.4045.84 ▼4.81
Posts /wp-admin/edit.php2,151 ▲512.04 ▲0.0239.68 ▼2.2435.75 ▼2.24
Add New Post /wp-admin/post-new.php1,567 ▲3923.65 ▲0.62656.32 ▼63.8654.71 ▼23.08
Media Library /wp-admin/upload.php1,454 ▲544.19 ▼0.02108.73 ▼2.7344.76 ▼1.79
Add New /wp-admin/post-new.php?post_type=pin2,9568.00185.8176.53
Pending importation /wp-admin/edit.php?post_type=pin&page=pending-importation1,0611.8326.6329.43
Pins /wp-admin/edit.php?post_type=pin1,2371.9634.1027.91
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=pin1,5032.2531.4933.77
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=pin1,3702.1226.6727.63
Settings /wp-admin/edit.php?post_type=pin&page=settings9472.0226.7230.89
Pinterest Account /wp-admin/edit.php?post_type=pin&page=account8722.0523.7630.79
Pinterest Boards /wp-admin/edit.php?post_type=pin&page=boards1,1451.7127.8229.34

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • _pinterest-importer-db_version
    • category_children
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=pin&page=boards
    • > Warning in wp-content/plugins/pinterest-importer/pinterest-importer.php+411
    count(): Parameter must be an array or an object that implements Countable

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
Almost there! Just fix the following items
  • 86× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/pinterest-importer/pinim-classes.php on line 862
    • > PHP Fatal error
      Uncaught Error: Class 'seregazhuk\\PinterestBot\\Api\\Providers\\Core\\EntityProvider' not found in wp-content/plugins/pinterest-importer/_inc/php/vendor/seregazhuk/pinterest-bot/src/Api/Providers/Core/FollowableProvider.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/pinterest-importer/_inc/php/vendor/seregazhuk/pinterest-bot/tests/Bot/Providers/Core/ProviderTest.php:18
    • > PHP Warning
      require(wp-content/plugins/pinterest-importer/_inc/php/vendor/seregazhuk/pinterest-bot/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/pinterest-importer/_inc/php/vendor/seregazhuk/pinterest-bot/examples/followers.php on line 3
    • > PHP Warning
      require(wp-content/plugins/pinterest-importer/_inc/php/vendor/seregazhuk/pinterest-bot/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/pinterest-importer/_inc/php/vendor/seregazhuk/pinterest-bot/examples/pins_parser.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'seregazhuk\\PinterestBot\\Api\\Providers\\Core\\Provider' not found in wp-content/plugins/pinterest-importer/_inc/php/vendor/seregazhuk/pinterest-bot/src/Api/Providers/Inbox.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'seregazhuk\\PinterestBot\\Api\\Providers\\Core\\Provider' not found in wp-content/plugins/pinterest-importer/_inc/php/vendor/seregazhuk/pinterest-bot/src/Api/Providers/Interests.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'seregazhuk\\PinterestBot\\Api\\Forms\\Form' not found in wp-content/plugins/pinterest-importer/_inc/php/vendor/seregazhuk/pinterest-bot/src/Api/Forms/Registration.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pinterest-importer/pinim-pending-imports.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'seregazhuk\\PinterestBot\\Api\\Providers\\Core\\Provider' not found in wp-content/plugins/pinterest-importer/_inc/php/vendor/seregazhuk/pinterest-bot/src/Api/Providers/Core/EntityProvider.php:11

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

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: backup, pinterest, importer, pins

pinterest-importer/pinterest-importer.php 92% from 13 tests

The entry point to "Pinterest Importer" version 0.7.2 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 164 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin11,148 lines of code in 141 files:
LanguageFilesBlank linesComment linesLines of code
PHP1132,7993,6318,678
Markdown1657401,742
Sass2653270
CSS1256234
JSON300104
YAML312049
JavaScript1244934
XML10029
Ruby1108

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity6.76
▷ Minimum class complexity1.00
▷ Maximum class complexity87.00
Average method complexity1.64
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces17
Interfaces2
Traits19
Classes85
▷ Abstract classes55.88%
▷ Concrete classes8094.12%
▷ Final classes00.00%
Methods788
▷ Static methods202.54%
▷ Public methods61377.79%
▷ Protected methods15319.42%
▷ Private methods222.79%
Functions68
▷ Named functions2942.65%
▷ Anonymous functions3957.35%
Constants110
▷ Global constants00.00%
▷ Class constants110100.00%
▷ Public constants110100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin