Hi there!
I have been fighting this data for some time now, and reached the point of needing some assistance in understanding how to tackle this
I am importing data about wordpress sites, and i specifically try to make a nice output og every plugin, and their data, version, slug, and so on.
The JSON input looks like this:
{
"id": "256125",
"userid": "1",
"adminname": "AUTHUSER",
"name": "testing-domain.dk",
"url": "https://testing-domain.dk/",
"pubkey": "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCZXkvV2Ezd1pGSmM1VXNFL1B6QmkyK24vUnJacC8KRFFJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg==",
"nossl": "0",
"nosslkey": "5ea86875191.5543",
"siteurl": "https://testing-domain.dk",
"ga_id": "",
"gas_id": "0",
"offline_checks_last": "1624532378",
"offline_check_result": "1",
"http_response_code": "200",
"note": "",
"note_lastupdate": "0",
"statsUpdate": "16040458",
"directories": "{\"wp-content\":{\"mu-plugins\":null,\"revslider\":{\"admin\":null,\"includes\":null,\"languages\":null,\"public\":null,\"backup\":null},\"upgrade\":null,\"languages\":{\"themes\":null,\"plugins\":null},\"themes\":{\"twentynineteen\":null,\"megalith\":null,\"twentyseventeen\":null,\"twentytwenty\":null},\"uploads\":{\"mainwp\":null,\"2016\":null,\"revslider\":null,\"js_composer\":null,\"2021\":null,\"wp-migrate-db\":null,\"2019\":null,\"2020\":null,\"2018\":null,\"2017\":null},\"plugins\":{\"wp-mail-smtp\":null,\"mainwp-child\":null,\"captcha-bank-pro-edition_\":null,\"login-lockdown\":null,\"simple-contact-info\":null,\"contact-form-7\":null,\"really-simple-ssl_\":null,\"revslider\":null,\"wp-statistics\":null,\"js_composer\":null}},\"wp-admin\":{\"user\":null,\"network\":null,\"includes\":null,\"css\":{\"colors\":null},\"images\":null,\"maint\":null,\"js\":{\"widgets\":null}},\"wp-includes\":{\"customize\":null,\"Text\":{\"Diff\":null},\"assets\":null,\"sitemaps\":{\"providers\":null},\"SimplePie\":{\"HTTP\":null,\"Content\":null,\"Parse\":null,\"Net\":null,\"Cache\":null,\"XML\":null,\"Decode\":null},\"rest-api\":{\"search\":null,\"fields\":null,\"endpoints\":null},\"random_compat\":null,\"IXR\":null,\"ID3\":null,\"theme-compat\":null}}",
"plugin_upgrades": "{\"akismet\\/akismet.php\":{\"Name\":\"Akismet Anti-Spam\",\"PluginURI\":\"https:\\/\\/akismet.com\\/\",\"Version\":\"4.1.6\",\"Description\":\"Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam<\\/strong>. It keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key.\",\"Author\":\"Automattic\",\"AuthorURI\":\"https:\\/\\/automattic.com\\/wordpress-plugins\\/\",\"TextDomain\":\"akismet\",\"DomainPath\":\"\",\"Network\":false,\"RequiresWP\":\"\",\"RequiresPHP\":\"\",\"Title\":\"Akismet Anti-Spam\",\"AuthorName\":\"Automattic\",\"update\":{\"id\":\"w.org\\/plugins\\/akismet\",\"slug\":\"akismet\",\"plugin\":\"akismet\\/akismet.php\",\"new_version\":\"4.1.10\",\"url\":\"https:\\/\\/wordpress.org\\/plugins\\/akismet\\/\",\"package\":\"https:\\/\\/downloads.wordpress.org\\/plugin\\/akismet.4.1.10.zip\",\"icons\":{\"2x\":\"https:\\/\\/ps.w.org\\/akismet\\/assets\\/icon-256x256.png?rev=969272\",\"1x\":\"https:\\/\\/ps.w.org\\/akismet\\/assets\\/icon-128x128.png?rev=969272\"},\"banners\":{\"1x\":\"https:\\/\\/ps.w.org\\/akismet\\/assets\\/banner-772x250.jpg?rev=479904\"},\"banners_rtl\":[],\"tested\":\"5.8\",\"requires_php\":false,\"compatibility\":[]},\"active\":0},\"contact-form-7\\/wp-contact-form-7.php\":{\"Name\":\"Contact Form 7\",\"PluginURI\":\"https:\\/\\/contactform7.com\\/\",\"Version\":\"5.2.1\",\"Description\":\"Just another contact form plugin. Simple but flexible.\",\"Author\":\"Takayuki Miyoshi\",\"AuthorURI\":\"https:\\/\\/ideasilo.wordpress.com\\/\",\"TextDomain\":\"contact-form-7\",\"DomainPath\":\"\\/languages\\/\",\"Network\":false,\"RequiresWP\":\"\",\"RequiresPHP\":\"\",\"Title\":\"Contact Form 7\",\"AuthorName\":\"Takayuki Miyoshi\",\"update\":{\"id\":\"w.org\\/plugins\\/contact-form-7\",\"slug\":\"contact-form-7\",\"plugin\":\"contact-form-7\\/wp-contact-form-7.php\",\"new_version\":\"5.4.1\",\"url\":\"https:\\/\\/wordpress.org\\/plugins\\/contact-form-7\\/\",\"package\":\"https:\\/\\/downloads.wordpress.org\\/plugin\\/contact-form-7.5.4.1.zip\",\"icons\":{\"2x\":\"https:\\/\\/ps.w.org\\/contact-form-7\\/assets\\/icon-256x256.png?rev=2279696\",\"1x\":\"https:\\/\\/ps.w.org\\/contact-form-7\\/assets\\/icon.svg?rev=2339255\",\"svg\":\"https:\\/\\/ps.w.org\\/contact-form-7\\/assets\\/icon.svg?rev=2339255\"},\"banners\":{\"2x\":\"https:\\/\\/ps.w.org\\/contact-form-7\\/assets\\/banner-1544x500.png?rev=860901\",\"1x\":\"https:\\/\\/ps.w.org\\/contact-form-7\\/assets\\/banner-772x250.png?rev=880427\"},\"banners_rtl\":[],\"tested\":\"5.7.2\",\"requires_php\":false,\"compatibility\":[]},\"active\":1},\"disable-comments\\/disable-comments.php\":{\"Name\":\"Disable Comments\",\"PluginURI\":\"https:\\/\\/wordpress.org\\/plugins\\/disable-comments\\/\",\"Version\":\"2.0.2\",\"Description\":\"Allows administrators to globally disable comments on their site. Comments can be disabled according to post type. You could bulk delete comments using Tools.\",\"Author\":\"WPDeveloper\",\"AuthorURI\":\"https:\\/\\/wpdeveloper.net\",\"TextDomain\":\"disable-comments\",\"DomainPath\":\"\\/languages\\/\",\"Network\":false,\"RequiresWP\":\"\",\"RequiresPHP\":\"\",\"Title\":\"Disable Comments\",\"AuthorName\":\"WPDeveloper\",\"update\":{\"id\":\"w.org\\/plugins\\/disable-comments\",\"slug\":\"disable-comments\",\"plugin\":\"disable-comments\\/disable-comments.php\",\"new_version\":\"2.1.2\",\"url\":\"https:\\/\\/wordpress.org\\/plugins\\/disable-comments\\/\",\"package\":\"https:\\/\\/downloads.wordpress.org\\/plugin\\/disable-comments.2.1.2.zip\",\"icons\":{\"2x\":\"https:\\/\\/ps.w.org\\/disable-comments\\/assets\\/icon-256x256.png?rev=2509854\",\"1x\":\"https:\\/\\/ps.w.org\\/disable-comments\\/assets\\/icon-128x128.png?rev=2509854\"},\"banners\":{\"2x\":\"https:\\/\\/ps.w.org\\/disable-comments\\/assets\\/banner-1544x500.png?rev=2509854\",\"1x\":\"https:\\/\\/ps.w.org\\/disable-comments\\/assets\\/banner-772x250.png?rev=2509854\"},\"banners_rtl\":[],\"tested\":\"5.7.2\",\"requires_php\":\"5.6\",\"compatibility\":[]},\"active\":1},\"mainwp-child\\/mainwp-child.php\":{\"Name\":\"MainWP Child\",\"PluginURI\":\"https:\\/\\/mainwp.com\\/\",\"Version\":\"4.1.2\",\"Description\":\"Provides a secure connection between your MainWP Dashboard and your WordPress sites. MainWP allows you to manage WP sites from one central location. Plugin documentation and options can be found here https:\\/\\/mainwp.com\\/help\\/.\",\"Author\":\"MainWP\",\"AuthorURI\":\"https:\\/\\/mainwp.com\",\"TextDomain\":\"mainwp-child\",\"DomainPath\":\"\",\"Network\":false,\"RequiresWP\":\"3.6\",\"RequiresPHP\":\"5.6\",\"Title\":\"MainWP Child\",\"AuthorName\":\"MainWP\",\"update\":{\"id\":\"w.org\\/plugins\\/mainwp-child\",\"slug\":\"mainwp-child\",\"plugin\":\"mainwp-child\\/mainwp-child.php\",\"new_version\":\"4.1.7\",\"url\":\"https:\\/\\/wordpress.org\\/plugins\\/mainwp-child\\/\",\"package\":\"https:\\/\\/downloads.wordpress.org\\/plugin\\/mainwp-child.4.1.7.zip\",\"icons\":{\"1x\":\"https:\\/\\/ps.w.org\\/mainwp-child\\/assets\\/icon-128x128.png?rev=2147214\"},\"banners\":{\"2x\":\"https:\\/\\/ps.w.org\\/mainwp-child\\/assets\\/banner-1544x500.jpg?rev=2150284\",\"1x\":\"https:\\/\\/ps.w.org\\/mainwp-child\\/assets\\/banner-772x250.jpg?rev=2150284\"},\"banners_rtl\":{\"2x\":\"https:\\/\\/ps.w.org\\/mainwp-child\\/assets\\/banner-1544x500-rtl.jpg?rev=2150284\",\"1x\":\"https:\\/\\/ps.w.org\\/mainwp-child\\/assets\\/banner-772x250-rtl.jpg?rev=2150284\"},\"tested\":\"5.7.2\",\"requires_php\":\"7.0\",\"compatibility\":[]},\"active\":1},\"mobile-menu\\/mobmenu.php\":{\"Name\":\"Mobile Menu\",\"PluginURI\":\"https:\\/\\/www.wpmobilemenu.com\\/\",\"Version\":\"2.8.1.8.1\",\"Description\":\"An easy to use WordPress responsive mobile menu. Keep your mobile visitors engaged.\",\"Author\":\"Rui Guerreiro\",\"AuthorURI\":\"https:\\/\\/www.jedipress.com\\/\",\"TextDomain\":\"mobile-menu\",\"DomainPath\":\"\\/languages\\/\",\"Network\":false,\"RequiresWP\":\"\",\"RequiresPHP\":\"\",\"Title\":\"Mobile Menu\",\"AuthorName\":\"Rui Guerreiro\",\"update\":{\"id\":\"w.org\\/plugins\\/mobile-menu\",\"slug\":\"mobile-menu\",\"plugin\":\"mobile-menu\\/mobmenu.php\",\"new_version\":\"2.8.2.2\",\"url\":\"https:\\/\\/wordpress.org\\/plugins\\/mobile-menu\\/\",\"package\":\"https:\\/\\/downloads.wordpress.org\\/plugin\\/mobile-menu.2.8.2.2.zip\",\"icons\":{\"1x\":\"https:\\/\\/ps.w.org\\/mobile-menu\\/assets\\/icon-128x128.png?rev=1890426\"},\"banners\":{\"1x\":\"https:\\/\\/ps.w.org\\/mobile-menu\\/assets\\/banner-772x250.jpg?rev=1976792\"},\"banners_rtl\":[],\"tested\":\"5.7.2\",\"requires_php\":\"5.6\",\"compatibility\":[]},\"active\":1},\"really-simple-ssl_\\/rlrsssl-really-simple-ssl.php\":{\"Name\":\"Really Simple SSL\",\"PluginURI\":\"https:\\/\\/www.really-simple-ssl.com\",\"Version\":\"3.3.4\",\"Description\":\"Lightweight plugin without any setup to make your site SSL proof\",\"Author\":\"Really Simple Plugins\",\"AuthorURI\":\"https:\\/\\/really-simple-plugins.com\",\"TextDomain\":\"really-simple-ssl\",\"DomainPath\":\"\\/languages\",\"Network\":false,\"RequiresWP\":\"\",\"RequiresPHP\":\"\",\"Title\":\"Really Simple SSL\",\"AuthorName\":\"Really Simple Plugins\",\"update\":{\"id\":\"w.org\\/plugins\\/really-simple-ssl\",\"slug\":\"really-simple-ssl\",\"plugin\":\"really-simple-ssl_\\/rlrsssl-really-simple-ssl.php\",\"new_version\":\"5.0.2\",\"url\":\"https:\\/\\/wordpress.org\\/plugins\\/really-simple-ssl\\/\",\"package\":\"https:\\/\\/downloads.wordpress.org\\/plugin\\/really-simple-ssl.5.0.2.zip\",\"icons\":{\"1x\":\"https:\\/\\/ps.w.org\\/really-simple-ssl\\/assets\\/icon-128x128.png?rev=1782452\"},\"banners\":{\"2x\":\"https:\\/\\/ps.w.org\\/really-simple-ssl\\/assets\\/banner-1544x500.png?rev=2320223\",\"1x\":\"https:\\/\\/ps.w.org\\/really-simple-ssl\\/assets\\/banner-772x250.png?rev=2320228\"},\"banners_rtl\":[],\"tested\":\"5.7.2\",\"requires_php\":\"5.6\",\"compatibility\":[]},\"active\":0},\"js_composer\\/js_composer.php\":{\"Name\":\"WPBakery Page Builder\",\"PluginURI\":\"http:\\/\\/wpbakery.com\",\"Version\":\"6.3.0\",\"Description\":\"Drag and drop page builder for WordPress. Take full control over your WordPress site, build any layout you can imagine \\u2013 no programming knowledge required.\",\"Author\":\"Michael M - WPBakery.com\",\"AuthorURI\":\"http:\\/\\/wpbakery.com\",\"TextDomain\":\"js_composer\",\"DomainPath\":\"\",\"Network\":false,\"RequiresWP\":\"\",\"RequiresPHP\":\"\",\"Title\":\"WPBakery Page Builder\",\"AuthorName\":\"Michael M - WPBakery.com\",\"update\":{\"slug\":\"js_composer\",\"new_version\":\"6.7\",\"plugin\":\"js_composer\\/js_composer.php\",\"url\":\"\",\"package\":false,\"name\":null},\"active\":1},\"wp-mail-smtp\\/wp_mail_smtp.php\":{\"Name\":\"WP Mail SMTP\",\"PluginURI\":\"https:\\/\\/wpmailsmtp.com\\/\",\"Version\":\"2.8.0\",\"Description\":\"Reconfigures the <code>wp_mail()<\\/code> function to use Gmail\\/Mailgun\\/SendGrid\\/SMTP instead of the default <code>mail()<\\/code> and creates an options page to manage the settings.\",\"Author\":\"WPForms\",\"AuthorURI\":\"https:\\/\\/wpforms.com\\/\",\"TextDomain\":\"wp-mail-smtp\",\"DomainPath\":\"\\/assets\\/languages\",\"Network\":false,\"RequiresWP\":\"4.9\",\"RequiresPHP\":\"5.6.20\",\"Title\":\"WP Mail SMTP\",\"AuthorName\":\"WPForms\",\"update\":{\"id\":\"w.org\\/plugins\\/wp-mail-smtp\",\"slug\":\"wp-mail-smtp\",\"plugin\":\"wp-mail-smtp\\/wp_mail_smtp.php\",\"new_version\":\"2.9.0\",\"url\":\"https:\\/\\/wordpress.org\\/plugins\\/wp-mail-smtp\\/\",\"package\":\"https:\\/\\/downloads.wordpress.org\\/plugin\\/wp-mail-smtp.2.9.0.zip\",\"icons\":{\"2x\":\"https:\\/\\/ps.w.org\\/wp-mail-smtp\\/assets\\/icon-256x256.png?rev=1755440\",\"1x\":\"https:\\/\\/ps.w.org\\/wp-mail-smtp\\/assets\\/icon-128x128.png?rev=1755440\"},\"banners\":{\"2x\":\"https:\\/\\/ps.w.org\\/wp-mail-smtp\\/assets\\/banner-1544x500.png?rev=2468655\",\"1x\":\"https:\\/\\/ps.w.org\\/wp-mail-smtp\\/assets\\/banner-772x250.png?rev=2468655\"},\"banners_rtl\":[],\"tested\":\"5.7.2\",\"requires_php\":\"5.6.20\",\"compatibility\":[]},\"active\":1},\"wp-migrate-db\\/wp-migrate-db.php\":{\"Name\":\"WP Migrate DB\",\"PluginURI\":\"https:\\/\\/wordpress.org\\/plugins\\/wp-migrate-db\\/\",\"Version\":\"1.0.15\",\"Description\":\"Exports your database as a MySQL data dump (much like phpMyAdmin), does a find and replace on URLs and file paths, then allows you to save it to your computer.\",\"Author\":\"Delicious Brains\",\"AuthorURI\":\"https:\\/\\/deliciousbrains.com\",\"TextDomain\":\"wp-migrate-db\",\"DomainPath\":\"\\/languages\\/\",\"Network\":true,\"RequiresWP\":\"\",\"RequiresPHP\":\"\",\"Title\":\"WP Migrate DB\",\"AuthorName\":\"Delicious Brains\",\"update\":{\"id\":\"w.org\\/plugins\\/wp-migrate-db\",\"slug\":\"wp-migrate-db\",\"plugin\":\"wp-migrate-db\\/wp-migrate-db.php\",\"new_version\":\"2.0.2\",\"url\":\"https:\\/\\/wordpress.org\\/plugins\\/wp-migrate-db\\/\",\"package\":\"https:\\/\\/downloads.wordpress.org\\/plugin\\/wp-migrate-db.2.0.2.zip\",\"icons\":{\"2x\":\"https:\\/\\/ps.w.org\\/wp-migrate-db\\/assets\\/icon-256x256.jpg?rev=1809889\",\"1x\":\"https:\\/\\/ps.w.org\\/wp-migrate-db\\/assets\\/icon-128x128.jpg?rev=1809889\"},\"banners\":{\"2x\":\"https:\\/\\/ps.w.org\\/wp-migrate-db\\/assets\\/banner-1544x500.jpg?rev=1809889\",\"1x\":\"https:\\/\\/ps.w.org\\/wp-migrate-db\\/assets\\/banner-772x250.jpg?rev=1809889\"},\"banners_rtl\":[],\"tested\":\"5.7.2\",\"requires_php\":\"5.6\",\"compatibility\":[]},\"active\":1},\"wp-statistics\\/wp-statistics.php\":{\"Name\":\"WP Statistics\",\"PluginURI\":\"https:\\/\\/wp-statistics.com\\/\",\"Version\":\"12.6.13\",\"Description\":\"Complete WordPress Analytics and Statistics for your site!\",\"Author\":\"VeronaLabs\",\"AuthorURI\":\"http:\\/\\/veronalabs.com\\/\",\"TextDomain\":\"wp-statistics\",\"DomainPath\":\"languages\",\"Network\":false,\"RequiresWP\":\"\",\"RequiresPHP\":\"\",\"Title\":\"WP Statistics\",\"AuthorName\":\"VeronaLabs\",\"update\":{\"id\":\"w.org\\/plugins\\/wp-statistics\",\"slug\":\"wp-statistics\",\"plugin\":\"wp-statistics\\/wp-statistics.php\",\"new_version\":\"13.0.8\",\"url\":\"https:\\/\\/wordpress.org\\/plugins\\/wp-statistics\\/\",\"package\":\"https:\\/\\/downloads.wordpress.org\\/plugin\\/wp-statistics.13.0.8.zip\",\"icons\":{\"2x\":\"https:\\/\\/ps.w.org\\/wp-statistics\\/assets\\/icon-256x256.png?rev=1673578\",\"1x\":\"https:\\/\\/ps.w.org\\/wp-statistics\\/assets\\/icon.svg?rev=2041108\",\"svg\":\"https:\\/\\/ps.w.org\\/wp-statistics\\/assets\\/icon.svg?rev=2041108\"},\"banners\":{\"1x\":\"https:\\/\\/ps.w.org\\/wp-statistics\\/assets\\/banner-772x250.png?rev=2041108\"},\"banners_rtl\":[],\"tested\":\"5.7.2\",\"requires_php\":\"5.6\",\"compatibility\":[]},\"active\":1}}",
"theme_upgrades": "{\"twentynineteen\":{\"update\":{\"theme\":\"twentynineteen\",\"new_version\":\"2.0\",\"url\":\"https:\\/\\/wordpress.org\\/themes\\/twentynineteen\\/\",\"package\":\"https:\\/\\/downloads.wordpress.org\\/theme\\/twentynineteen.2.0.zip\",\"requires\":\"4.9.6\",\"requires_php\":\"5.2.4\"},\"Name\":\"Twenty Nineteen\",\"Version\":\"1.7\",\"active\":0},\"twentyseventeen\":{\"update\":{\"theme\":\"twentyseventeen\",\"new_version\":\"2.7\",\"url\":\"https:\\/\\/wordpress.org\\/themes\\/twentyseventeen\\/\",\"package\":\"https:\\/\\/downloads.wordpress.org\\/theme\\/twentyseventeen.2.7.zip\",\"requires\":\"4.7\",\"requires_php\":\"5.2.4\"},\"Name\":\"Twenty Seventeen\",\"Version\":\"2.4\",\"active\":0},\"twentytwenty\":{\"update\":{\"theme\":\"twentytwenty\",\"new_version\":\"1.7\",\"url\":\"https:\\/\\/wordpress.org\\/themes\\/twentytwenty\\/\",\"package\":\"https:\\/\\/downloads.wordpress.org\\/theme\\/twentytwenty.1.7.zip\",\"requires\":\"4.7\",\"requires_php\":\"5.2.4\"},\"Name\":\"Twenty Twenty\",\"Version\":\"1.5\",\"active\":0}}",
"translation_upgrades": "[]",
"premium_upgrades": "",
"securityIssues": "0",
"themes": "[{\"name\":\"Megalith\",\"title\":\"Megalith\",\"description\":\"Creative Multipurpose HTML Template\",\"version\":\"1.2.12\",\"active\":1,\"slug\":\"megalith\"},{\"name\":\"Twenty Nineteen\",\"title\":\"Twenty Nineteen\",\"description\":\"Our 2019 default theme is designed to show off the power of the block editor. It features custom styles for all the default blocks, and is built so that what you see in the editor looks like what you’ll see on your website. Twenty Nineteen is designed to be adaptable to a wide range of websites, whether you\\u2019re running a photo blog, launching a new business, or supporting a non-profit. Featuring ample whitespace and modern sans-serif headlines paired with classic serif body text, it’s built to be beautiful on all screen sizes.\",\"version\":\"1.7\",\"active\":0,\"slug\":\"twentynineteen\"},{\"name\":\"Twenty Seventeen\",\"title\":\"Twenty Seventeen\",\"description\":\"Twenty Seventeen brings your site to life with header video and immersive featured images. With a focus on business sites, it features multiple sections on the front page as well as widgets, navigation and social menus, a logo, and more. Personalize its asymmetrical grid with a custom color scheme and showcase your multimedia content with post formats. Our default theme for 2017 works great in many languages, for any abilities, and on any device.\",\"version\":\"2.4\",\"active\":0,\"slug\":\"twentyseventeen\"},{\"name\":\"Twenty Twenty\",\"title\":\"Twenty Twenty\",\"description\":\"Our default theme for 2020 is designed to take full advantage of the flexibility of the block editor. Organizations and businesses have the ability to create dynamic landing pages with endless layouts using the group and column blocks. The centered content column and fine-tuned typography also makes it perfect for traditional blogs. Complete editor styles give you a good idea of what your content will look like, even before you publish. You can give your site a personal touch by changing the background colors and the accent color in the Customizer. The colors of all elements on your site are automatically calculated based on the colors you pick, ensuring a high, accessible color contrast for your visitors.\",\"version\":\"1.5\",\"active\":0,\"slug\":\"twentytwenty\"}]",
"ignored_themes": "",
"plugins": "[{\"mainwp\":\"F\",\"name\":\"Akismet Anti-Spam\",\"slug\":\"akismet\\/akismet.php\",\"description\":\"Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam<\\/strong>. It keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key.\",\"version\":\"4.1.6\",\"active\":0},{\"mainwp\":\"F\",\"name\":\"Captcha Bank Pro Edition\",\"slug\":\"captcha-bank-pro-edition_\\/captcha-bank-pro-edition.php\",\"description\":\"This plugin allows you to implement security captcha form into web forms to prevent spam.\",\"version\":\"4.1.34\",\"active\":0},{\"mainwp\":\"F\",\"name\":\"Contact Form 7\",\"slug\":\"contact-form-7\\/wp-contact-form-7.php\",\"description\":\"Just another contact form plugin. Simple but flexible.\",\"version\":\"5.2.1\",\"active\":1},{\"mainwp\":\"F\",\"name\":\"Custom Facebook Feed Pro Developer\",\"slug\":\"custom-facebook-feed-pro\\/custom-facebook-feed.php\",\"description\":\"Add a completely customizable Facebook feed to your WordPress site\",\"version\":\"2.6.7\",\"active\":1},{\"mainwp\":\"F\",\"name\":\"Dashboard Cleanup\",\"slug\":\"dashboard-cleanup\\/dashboard-cleanup.php\",\"description\":\"Remove options include wordpress.org feed, recent drafts, right now, recent comments, incoming links, plugins box, quick press. See readme.txt before activating!\",\"version\":\"1.1\",\"active\":1},{\"mainwp\":\"F\",\"name\":\"Disable Comments\",\"slug\":\"disable-comments\\/disable-comments.php\",\"description\":\"Allows administrators to globally disable comments on their site. Comments can be disabled according to post type. You could bulk delete comments using Tools.\",\"version\":\"2.0.2\",\"active\":1},{\"mainwp\":\"F\",\"name\":\"Login LockDown\",\"slug\":\"login-lockdown\\/loginlockdown.php\",\"description\":\"Adds some extra security to WordPress by restricting the rate at which failed logins can be re-attempted from a given IP range. Distributed through <a href=\\\"http:\\/\\/www.bad-neighborhood.com\\/\\\" target=\\\"_blank\\\">Bad Neighborhood<\\/a>.\",\"version\":\"v1.8.1\",\"active\":1},{\"mainwp\":\"T\",\"name\":\"MainWP Child\",\"slug\":\"mainwp-child\\/mainwp-child.php\",\"description\":\"Provides a secure connection between your MainWP Dashboard and your WordPress sites. MainWP allows you to manage WP sites from one central location. Plugin documentation and options can be found here https:\\/\\/mainwp.com\\/help\\/.\",\"version\":\"4.1.2\",\"active\":1},{\"mainwp\":\"F\",\"name\":\"Mobile Menu\",\"slug\":\"mobile-menu\\/mobmenu.php\",\"description\":\"An easy to use WordPress responsive mobile menu. Keep your mobile visitors engaged.\",\"version\":\"2.8.1.8.1\",\"active\":1},{\"mainwp\":\"F\",\"name\":\"Really Simple SSL\",\"slug\":\"really-simple-ssl_\\/rlrsssl-really-simple-ssl.php\",\"description\":\"Lightweight plugin without any setup to make your site SSL proof\",\"version\":\"3.3.4\",\"active\":0},{\"mainwp\":\"F\",\"name\":\"Simple Contact Info\",\"slug\":\"simple-contact-info\\/contact-info.php\",\"description\":\"You can write contact information (facebook, phone, fax, address etc). You can use widgets or shortcode to display it anywhere you want.\",\"version\":\"1.1.9\",\"active\":1},{\"mainwp\":\"F\",\"name\":\"Slider Revolution\",\"slug\":\"revslider\\/revslider.php\",\"description\":\"Slider Revolution - Premium responsive slider\",\"version\":\"6.2.22\",\"active\":1},{\"mainwp\":\"F\",\"name\":\"TeslaThemes Megalith posts\",\"slug\":\"teslathemes-custom-posts\\/teslathemes-custom-posts.php\",\"description\":\"Teslathemes custom posts\",\"version\":\"1.2.1\",\"active\":1},{\"mainwp\":\"F\",\"name\":\"WPBakery Page Builder\",\"slug\":\"js_composer\\/js_composer.php\",\"description\":\"Drag and drop page builder for WordPress. Take full control over your WordPress site, build any layout you can imagine \\u2013 no programming knowledge required.\",\"version\":\"6.3.0\",\"active\":1},{\"mainwp\":\"F\",\"name\":\"WP Mail SMTP\",\"slug\":\"wp-mail-smtp\\/wp_mail_smtp.php\",\"description\":\"Reconfigures the <code>wp_mail()<\\/code> function to use Gmail\\/Mailgun\\/SendGrid\\/SMTP instead of the default <code>mail()<\\/code> and creates an options page to manage the settings.\",\"version\":\"2.8.0\",\"active\":1},{\"mainwp\":\"F\",\"name\":\"WP Migrate DB\",\"slug\":\"wp-migrate-db\\/wp-migrate-db.php\",\"description\":\"Exports your database as a MySQL data dump (much like phpMyAdmin), does a find and replace on URLs and file paths, then allows you to save it to your computer.\",\"version\":\"1.0.15\",\"active\":1},{\"mainwp\":\"F\",\"name\":\"WP Statistics\",\"slug\":\"wp-statistics\\/wp-statistics.php\",\"description\":\"Complete WordPress Analytics and Statistics for your site!\",\"version\":\"12.6.13\",\"active\":1},{\"mainwp\":\"F\",\"name\":\"WP Migrate DB Compatibility\",\"slug\":\"wp-migrate-db-pro-compatibility.php\",\"description\":\"Prevents 3rd party plugins from being loaded during WP Migrate DB specific operations\",\"version\":\"1.2\",\"active\":1,\"mu\":1}]",
"ignored_plugins": "",
"pages": "",
"users": "[]",
"categories": "[\"Ikke kategoriseret\"]",
"pluginDir": "",
"automatic_update": "0",
"backup_before_upgrade": "2",
"backups": "",
"mainwpdir": "1",
"loadFilesBeforeZip": "0",
"is_ignoreCoreUpdates": "0",
"is_ignorePluginUpdates": "0",
"is_ignoreThemeUpdates": "0",
"verify_certificate": "0",
"force_use_ipv4": "0",
"ssl_version": "0",
"ip": "",
"uniqueId": "",
"maximumFileDescriptorsOverride": "0",
"maximumFileDescriptorsAuto": "0",
"maximumFileDescriptors": "150",
"http_user": "",
"http_pass": "",
"wpe": "0",
"is_staging": "0",
"http_code_noticed": "1",
"disable_status_check": "0",
"disable_health_check": "0",
"status_check_interval": "0",
"health_threshold": "0",
"wpid": "25",
"version": "4.1.2",
"sync_errors": "",
"dtsAutomaticSync": "1606560962",
"dtsAutomaticSyncStart": "1606560951",
"dtsSync": "1626071493",
"dtsSyncStart": "1626071489",
"totalsize": "0",
"dbsize": "5144676",
"extauth": "8a78cd60e9bea8a308df",
"last_post_gmt": "0",
"health_value": "80",
"health_site_noticed": "0",
"uptodate": "",
"sync_id": "12",
"recent_comments": "[]",
"recent_posts": "[]",
"recent_pages": "[{\"id\":57,\"post_type\":\"page\",\"status\":\"publish\",\"title\":\"Kontakt\",\"comment_count\":\"0\",\"dts\":1475134637,\"author\":\"author\",\"categories\":\"\",\"tags\":\"\"},{\"id\":54,\"post_type\":\"page\",\"status\":\"publish\",\"title\":\"Galleri\",\"comment_count\":\"0\",\"dts\":1472799173,\"author\":\"author\",\"categories\":\"\",\"tags\":\"\"},{\"id\":51,\"post_type\":\"page\",\"status\":\"publish\",\"title\":\"Datalogger\",\"comment_count\":\"0\",\"dts\":1546500587,\"author\":\"author\",\"categories\":\"\",\"tags\":\"\"},{\"id\":48,\"post_type\":\"page\",\"status\":\"publish\",\"title\":\"Milj\\u00f8udstyr\",\"comment_count\":\"0\",\"dts\":1546500523,\"author\":\"author\",\"categories\":\"\",\"tags\":\"\"},{\"id\":45,\"post_type\":\"page\",\"status\":\"publish\",\"title\":\"Diverse ure\",\"comment_count\":\"0\",\"dts\":1546500398,\"author\":\"author\",\"categories\":\"\",\"tags\":\"\"}]",
"phpversion": "7.4.21",
"wp_upgrades": "{\"current\":\"5.5.5\",\"new\":\"5.7.2\"}",
"favi_icon": "favi-25-favicon.ico"
}
I have already made a separation, so i only get the plugin part.
This just done with this script:
$cosandsec = "consumer_key=ck_SECRET&consumer_secret=cs_SECRET"
$FileList = (Get-ChildItem 'C:\Users\jtn\Desktop\PS2020\MainWP\full-plugin-version\input\input.txt').fullname
$c1 = 0
$m = Get-Content -Path $FileList | Measure-Object -line
@($m).lines
$myOutput = @() # Declare empty array
Write-host "websiteid,pluginname"
foreach ($listedid in $FileList) {
$myOutput += foreach ($websiteid in (Get-Content $listedid)) {
try {
$c1++
Write-Progress -Id 0 -Activity 'Running theme scan' -Status "Processing $($c1) of $(@($m).lines)" -CurrentOperation $websiteid -PercentComplete (($c1 / @($m).lines) * 100)
$Url = "https://mainwpdashboard.dk/wp-json/mainwp/v1/site/site?site_id=$($websiteid)&$($cosandsec)"
$updateprocess = Invoke-RestMethod -Method 'Get' -Uri $url
foreach ($line in $updateprocess) {
write-host "$websiteid,$websitename"
$websitename = $line.name
$plugins = $line.plugins
write-host $plugins
# Something similar to this??
# foreach ($soloplugin in $plugins) {
# write-host $plugins.name
# write-host $plugins.version
# }
}
[PSCustomObject]@{
websiteid = $websiteid
websitenameurl = $websitename
plugins = $plugins
Exceptionmessage = $updateProcess.success
StatusdescriptionValue = '200'
Statusdescription = 'SUCCESS'
}
}
catch {
# catcherrors
[PSCustomObject]@{
websiteid = $websiteid
websitenameurl = $websitename
Exceptionmessage = $_.Exception.Message
StatusdescriptionValue = $_.Exception.Response.StatusCode.value__
Statusdescription = $_.Exception.Response.StatusDescription
}
}
}
}
$myOutput | Select-Object -Property websiteid,
websitenameurl,
Exceptionmessage,
Exceptionresponse,
StatusdescriptionValue,
Statusdescription |
Export-Csv -NoTypeInformation -Path C:\Users\jtn\Desktop\PS2020\MainWP\full-plugin-version\output\output.csv
# or
$myOutput | Out-GridView
This then gives me this for now:
[{"mainwp":"F","name":"Contact Form 7","slug":"contact-form-7\/wp-contact-form-7.php","description":"Just another contact form plugin. Simple but flexible.","version":"5.1.4","active":0},{"mainwp":"F","name":"Coo
kie Bar","slug":"cookie-bar\/cookie-bar.php","description":"Cookie Bar allows you to discreetly inform visitors that your website uses cookies.","version":"1.8.6","active":0},{"mainwp":"F","name":"Custom Facebook
Feed Pro Developer","slug":"custom-facebook-feed-pro\/custom-facebook-feed.php","description":"Add a completely customizable Facebook feed to your WordPress site","version":"3.2.4","active":1},{"mainwp":"F","nam
e":"Disable Comments","slug":"disable-comments\/disable-comments.php","description":"Allows administrators to globally disable comments on their site. Comments can be disabled according to post type.","version":"
1.7.1","active":1},{"mainwp":"F","name":"Envira Gallery","slug":"envira-gallery\/envira-gallery.php","description":"Envira Gallery is best responsive WordPress gallery plugin.","version":"1.7.1","active":1},{"mai
nwp":"F","name":"Export & Import Templates for WPBakery Page Builder","slug":"vc-templates-import-export\/vc-templates-import-export.php","description":"Export & Import Templates for WPBakery Page Builder (Saved
Templates\/My Templates) in few clicks","version":"1.0.0","active":1},{"mainwp":"F","name":"Insert Headers and Footers","slug":"insert-headers-and-footers\/ihaf.php","description":"Allows you to insert code or te
xt in the header or footer of your WordPress blog","version":"1.4.4","active":1},{"mainwp":"F","name":"Loco Translate","slug":"loco-translate\/loco.php","description":"Translate themes and plugins directly in Wor
dPress","version":"2.3.1","active":1},{"mainwp":"F","name":"Login LockDown","slug":"login-lockdown\/loginlockdown.php","description":"Adds some extra security to WordPress by restricting the rate at which failed
logins can be re-attempted from a given IP range. Distributed through <a href=\"http:\/\/www.bad-neighborhood.com\/\" target=\"_blank\">Bad Neighborhood<\/a>.","version":"v1.8.1","active":1},{"mainwp":"T","name":
"MainWP Child","slug":"mainwp-child\/mainwp-child.php","description":"Provides a secure connection between your MainWP Dashboard and your WordPress sites. MainWP allows you to manage WP sites from one central loc
ation. Plugin documentation and options can be found here https:\/\/mainwp.com\/help\/.","version":"4.1.2","active":1},{"mainwp":"F","name":"Mobile Menu","slug":"mobile-menu\/mobmenu.php","description":"An easy t
o use WordPress responsive mobile menu. Keep your mobile visitors engaged.","version":"2.7.4.4","active":1},{"mainwp":"F","name":"Ninja Forms","slug":"ninja-forms\/ninja-forms.php","description":"Ninja Forms is a
webform builder with unparalleled ease of use and features.","version":"3.2.14","active":1},{"mainwp":"F","name":"Simple 301 Redirects","slug":"simple-301-redirects\/wp-simple-301-redirects.php","description":"C
reate a list of URLs that you would like to 301 redirect to another page or site. Now with wildcard support.","version":"1.07","active":1},{"mainwp":"F","name":"Slider Revolution","slug":"revslider\/revslider.php
","description":"Slider Revolution - Premium responsive slider","version":"6.2.22","active":1},{"mainwp":"F","name":"SVG Support","slug":"svg-support\/svg-support.php","description":"Upload SVG files to the Media
Library and render SVG files inline for direct styling\/animation of an SVG's internal elements using CSS\/JS.","version":"2.3.15","active":1},{"mainwp":"F","name":"Tesla Framework","slug":"tesla-framework\/tesl
a-framework-plugin.php","description":"Tesla Framework","version":"1.2.5","active":1},{"mainwp":"F","name":"TeslaThemes Megalith posts","slug":"teslathemes-custom-posts\/teslathemes-custom-posts.php","description
":"Teslathemes custom posts","version":"1.2.1","active":1},{"mainwp":"F","name":"Ultimate Addons for Visual Composer","slug":"Ultimate_VC_Addons\/Ultimate_VC_Addons.php","description":"Includes Visual Composer pr
emium addon elements like Icon, Info Box, Interactive Banner, Flip Box, Info List & Counter. Best of all - provides A Font Icon Manager allowing users to upload \/ delete custom icon fonts.","version":"3.16.21","
active":1},{"mainwp":"F","name":"WooCommerce","slug":"woocommerce\/woocommerce.php","description":"An eCommerce toolkit that helps you sell anything. Beautifully.","version":"3.8.0","active":0},{"mainwp":"F","nam
e":"WPBakery Page Builder","slug":"js_composer\/js_composer.php","description":"Drag and drop page builder for WordPress. Take full control over your WordPress site, build any layout you can imagine \u2013 no pro
gramming knowledge required.","version":"6.3.0","active":1},{"mainwp":"F","name":"WP Mail SMTP","slug":"wp-mail-smtp\/wp_mail_smtp.php","description":"Reconfigures the <code>wp_mail()<\/code> function to use Gmai
l\/Mailgun\/SendGrid\/SMTP instead of the default <code>mail()<\/code> and creates an options page to manage the settings.","version":"2.4.0","active":1},{"mainwp":"F","name":"WP Statistics","slug":"wp-statistics
\/wp-statistics.php","description":"Complete WordPress Analytics and Statistics for your site!","version":"12.6.10","active":1}]
What i cant seem to figure out, is how i split these individual plugins and their information from here.
I have tried to convert to objects, split, and so forth with strange results.
Every plugin is packed inside curly brackers, and the name and value split between “:” and commas. “{ info
}”.
I’m guessing it should be relatively straight forward to make these plugins and their information into objects that can be handled like json again?
So that “slug” can be picked with $plugins.slug and so on.
I really hope someone can help me out here, i am lost