├── vendor └── .gitkeep ├── web ├── app │ ├── themes │ │ ├── .gitkeep │ │ └── outlandish │ │ │ ├── screenshot.png │ │ │ ├── home.php │ │ │ ├── single-person.php │ │ │ ├── single-skill.php │ │ │ ├── index.php │ │ │ ├── functions.php │ │ │ ├── src │ │ │ ├── Views │ │ │ │ ├── SkillView.php │ │ │ │ ├── PersonView.php │ │ │ │ ├── RelatedItems.php │ │ │ │ ├── HomeView.php │ │ │ │ └── Layout.php │ │ │ └── PostTypes │ │ │ │ ├── Skill.php │ │ │ │ └── Person.php │ │ │ └── style.css │ ├── plugins │ │ └── .gitkeep │ ├── uploads │ │ └── .gitkeep │ └── mu-plugins │ │ ├── register-theme-directory.php │ │ ├── disallow-indexing.php │ │ └── bedrock-autoloader.php ├── index.php └── wp-config.php ├── wp-cli.yml ├── config ├── environments │ ├── development.php │ ├── staging.php │ └── production.php └── application.php ├── README.md ├── .gitignore ├── .env.example ├── LICENSE.md ├── composer.json ├── CHANGELOG.md └── composer.lock /vendor/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/app/themes/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/app/plugins/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/app/uploads/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /wp-cli.yml: -------------------------------------------------------------------------------- 1 | path: web/wp 2 | -------------------------------------------------------------------------------- /web/app/themes/outlandish/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/outlandishideas/oowp-boilerplate/master/web/app/themes/outlandish/screenshot.png -------------------------------------------------------------------------------- /web/index.php: -------------------------------------------------------------------------------- 1 | render(); -------------------------------------------------------------------------------- /config/environments/development.php: -------------------------------------------------------------------------------- 1 | render(); 6 | -------------------------------------------------------------------------------- /web/app/themes/outlandish/single-skill.php: -------------------------------------------------------------------------------- 1 | render(); 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OOWP Boilerplate 2 | 3 | Demonstrates how to build a simple website using [OOWP](https://github.com/outlandishideas/oowp) 4 | 5 | Built on [Bedrock](https://roots.io/bedrock/) 6 | -------------------------------------------------------------------------------- /web/app/themes/outlandish/index.php: -------------------------------------------------------------------------------- 1 | render(); 7 | -------------------------------------------------------------------------------- /config/environments/staging.php: -------------------------------------------------------------------------------- 1 | registerPostTypes([ 9 | Person::class, 10 | Skill::class 11 | ]); 12 | 13 | wp_enqueue_style('oowp-boilerplate', get_template_directory_uri() . '/style.css'); 14 | }); 15 | -------------------------------------------------------------------------------- /web/app/themes/outlandish/src/Views/SkillView.php: -------------------------------------------------------------------------------- 1 | post; 13 | $related = new RelatedItems('People', $skill->people()); 14 | ?> 15 |

Skill: title(); ?>

16 | render(); ?> 17 | post; 14 | $nickname = $person->nickname(); 15 | $related = new RelatedItems('Skills', $person->skills()); 16 | ?> 17 |

Person: title() . ($nickname ? ' (' . $nickname . ')' : ''); ?>

18 | render(); ?> 19 | title = $title; 22 | $this->items = $items; 23 | } 24 | 25 | public function render($args = []) 26 | { 27 | ?> 28 |

title; ?>:

29 | 34 | connected(Person::postType()); 34 | } 35 | } -------------------------------------------------------------------------------- /web/app/themes/outlandish/src/Views/HomeView.php: -------------------------------------------------------------------------------- 1 | 14 | 15 |

Oowp Boilerplate Theme

16 |
17 | 18 |
19 |

htmlLink(); ?>

20 |
21 | skills() as $skill) : ?> 22 | 23 | title(); ?> 24 | 25 | 26 |
27 |
28 | 29 |
30 | 31 | =5.6", 31 | "composer/installers": "1.2.0", 32 | "vlucas/phpdotenv": "2.4.0", 33 | "johnpbloch/wordpress": "4.7.4", 34 | "oscarotero/env": "1.0.2", 35 | "roots/wp-password-bcrypt": "1.0.0", 36 | "outlandish/oowp": "2.0.2", 37 | "wpackagist-plugin/advanced-custom-fields": "4.4.11", 38 | "wpackagist-plugin/posts-to-posts": "1.6.5" 39 | }, 40 | "extra": { 41 | "installer-paths": { 42 | "web/app/mu-plugins/{$name}/": ["type:wordpress-muplugin"], 43 | "web/app/plugins/{$name}/": ["type:wordpress-plugin"], 44 | "web/app/themes/{$name}/": ["type:wordpress-theme"] 45 | }, 46 | "wordpress-install-dir": "web/wp" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /web/app/themes/outlandish/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: OOWP Boilerplate 3 | Theme URI: 4 | Author: Outlandish 5 | Author URI: http://outlandish.com 6 | Description: OOWP Boilerplate Theme 7 | Version: 1.0 8 | License: GNU General Public License v2 or later 9 | License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 | Tags: 11 | Text Domain: outlandish 12 | */ 13 | 14 | body { 15 | font-family: sans-serif; 16 | } 17 | 18 | .home_view .people .person { 19 | float: left; 20 | border: 1px solid #aaa; 21 | background: #ddd; 22 | height: 150px; 23 | width: 150px; 24 | margin-bottom: 20px; 25 | } 26 | 27 | .home_view .people .person a { 28 | text-decoration: none; 29 | color: #333; 30 | } 31 | 32 | .home_view .people .person a:hover { 33 | color: #900; 34 | } 35 | 36 | .home_view .people .person h2 { 37 | text-align: center; 38 | background: #ccc; 39 | border-bottom: 1px solid #aaa; 40 | margin: 0; 41 | padding: 5px 0; 42 | } 43 | 44 | .home_view .people .person + .person { 45 | margin-left: 20px; 46 | } 47 | 48 | .home_view .people .person .skills { 49 | padding: 10px; 50 | } 51 | 52 | .home_view .people .person .skill { 53 | float: left; 54 | border: 1px solid #aaa; 55 | margin-bottom: 10px; 56 | background: #eee; 57 | padding: 5px 8px; 58 | } 59 | 60 | .home_view .people .person .skill:hover { 61 | background: #ddd; 62 | } 63 | 64 | .home_view .people .person .skill + .skill { 65 | margin-left: 10px; 66 | } 67 | -------------------------------------------------------------------------------- /web/app/themes/outlandish/src/Views/Layout.php: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | <?php echo $this->post->title(); ?> 21 | 22 | 23 | 24 | 25 | 26 |
27 | 30 |
31 | 32 |
33 | renderContent(); ?> 34 |
35 | 36 | 39 | 40 | 41 | 42 | post = $page; 57 | $view->render(); 58 | } 59 | } 60 | 61 | function renderContent() 62 | { 63 | $view = new SimplePost(); 64 | $view->render(); 65 | } 66 | } -------------------------------------------------------------------------------- /config/application.php: -------------------------------------------------------------------------------- 1 | load(); 20 | $dotenv->required(['DB_NAME', 'DB_USER', 'DB_PASSWORD', 'WP_HOME', 'WP_SITEURL']); 21 | } 22 | 23 | /** 24 | * Set up our global environment constant and load its config first 25 | * Default: production 26 | */ 27 | define('WP_ENV', env('WP_ENV') ?: 'production'); 28 | 29 | $env_config = __DIR__ . '/environments/' . WP_ENV . '.php'; 30 | 31 | if (file_exists($env_config)) { 32 | require_once $env_config; 33 | } 34 | 35 | /** 36 | * URLs 37 | */ 38 | define('WP_HOME', env('WP_HOME')); 39 | define('WP_SITEURL', env('WP_SITEURL')); 40 | 41 | /** 42 | * Custom Content Directory 43 | */ 44 | define('CONTENT_DIR', '/app'); 45 | define('WP_CONTENT_DIR', $webroot_dir . CONTENT_DIR); 46 | define('WP_CONTENT_URL', WP_HOME . CONTENT_DIR); 47 | 48 | /** 49 | * DB settings 50 | */ 51 | define('DB_NAME', env('DB_NAME')); 52 | define('DB_USER', env('DB_USER')); 53 | define('DB_PASSWORD', env('DB_PASSWORD')); 54 | define('DB_HOST', env('DB_HOST') ?: 'localhost'); 55 | define('DB_CHARSET', 'utf8mb4'); 56 | define('DB_COLLATE', ''); 57 | $table_prefix = env('DB_PREFIX') ?: 'wp_'; 58 | 59 | /** 60 | * Authentication Unique Keys and Salts 61 | */ 62 | define('AUTH_KEY', env('AUTH_KEY')); 63 | define('SECURE_AUTH_KEY', env('SECURE_AUTH_KEY')); 64 | define('LOGGED_IN_KEY', env('LOGGED_IN_KEY')); 65 | define('NONCE_KEY', env('NONCE_KEY')); 66 | define('AUTH_SALT', env('AUTH_SALT')); 67 | define('SECURE_AUTH_SALT', env('SECURE_AUTH_SALT')); 68 | define('LOGGED_IN_SALT', env('LOGGED_IN_SALT')); 69 | define('NONCE_SALT', env('NONCE_SALT')); 70 | 71 | /** 72 | * Custom Settings 73 | */ 74 | define('AUTOMATIC_UPDATER_DISABLED', true); 75 | define('DISABLE_WP_CRON', env('DISABLE_WP_CRON') ?: false); 76 | define('DISALLOW_FILE_EDIT', true); 77 | 78 | /** 79 | * Bootstrap WordPress 80 | */ 81 | if (!defined('ABSPATH')) { 82 | define('ABSPATH', $webroot_dir . '/wp/'); 83 | } 84 | -------------------------------------------------------------------------------- /web/app/themes/outlandish/src/PostTypes/Person.php: -------------------------------------------------------------------------------- 1 | 'acf_people', 23 | 'title' => 'People', 24 | 'fields' => array ( 25 | array ( 26 | 'key' => 'field_58fe168272d0c', 27 | 'label' => 'Nickname', 28 | 'name' => 'nickname', 29 | 'type' => 'text', 30 | 'default_value' => '', 31 | 'placeholder' => '', 32 | 'prepend' => '', 33 | 'append' => '', 34 | 'formatting' => 'html', 35 | 'maxlength' => '', 36 | ), 37 | array ( 38 | 'key' => 'field_58fe16eb4027a', 39 | 'label' => 'Date of Birth', 40 | 'name' => 'dob', 41 | 'type' => 'date_picker', 42 | 'required' => 1, 43 | 'date_format' => 'yymmdd', 44 | 'display_format' => 'dd/mm/yy', 45 | 'first_day' => 1, 46 | ), 47 | ), 48 | 'location' => array ( 49 | array ( 50 | array ( 51 | 'param' => 'post_type', 52 | 'operator' => '==', 53 | 'value' => 'person', 54 | 'order_no' => 0, 55 | 'group_no' => 0, 56 | ), 57 | ), 58 | ), 59 | 'options' => array ( 60 | 'position' => 'normal', 61 | 'layout' => 'no_box', 62 | 'hide_on_screen' => array ( 63 | ), 64 | ), 65 | 'menu_order' => 0, 66 | )); 67 | } 68 | } 69 | 70 | 71 | static function getRegistrationArgs($defaults) { 72 | $defaults['menu_icon'] = 'dashicons-groups'; 73 | return parent::getRegistrationArgs($defaults); 74 | } 75 | 76 | static function addCustomAdminColumns(ArrayHelper $helper) 77 | { 78 | $helper->insertAfter('title', 'nickname', 'Nickname'); 79 | $helper->insertAfter('nickname', 'dob', 'Date of Birth'); 80 | } 81 | 82 | function nickname() 83 | { 84 | return $this->metadata('nickname'); 85 | } 86 | 87 | function dob() 88 | { 89 | $dob = $this->metadata('dob'); 90 | if ($dob) { 91 | $dob = DateTime::createFromFormat('Ymd', $dob); 92 | if ($dob) { 93 | $dob = $dob->format('jS M Y'); 94 | } 95 | } 96 | return $dob; 97 | } 98 | 99 | function getCustomAdminColumnValue($column) 100 | { 101 | switch($column) { 102 | case 'nickname': 103 | return $this->nickname() ?: '-'; 104 | case 'dob': 105 | return $this->dob() ?: '-'; 106 | default: 107 | return parent::getCustomAdminColumnValue($column); 108 | } 109 | } 110 | 111 | public static function postTypeParentId() 112 | { 113 | return 2; 114 | } 115 | 116 | /** 117 | * @return OowpQuery|Skill[] 118 | */ 119 | public function skills() 120 | { 121 | return $this->connected(Skill::postType()); 122 | } 123 | 124 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ### 1.7.7: 2017-04-20 2 | 3 | * Update to WordPress 4.7.4 4 | 5 | ### 1.7.6: 2017-03-06 6 | 7 | * Update to WordPress 4.7.3 8 | 9 | ### 1.7.5: 2017-01-26 10 | 11 | * Update to WordPress 4.7.2 12 | 13 | ### 1.7.4: 2017-01-11 14 | 15 | * Update to WordPress 4.7.1 16 | * Add Optional variables to `.env.example` 17 | * Remove unnecessary gitignore rules ([#286](https://github.com/roots/bedrock/pull/286)) 18 | 19 | ### 1.7.3: 2016-12-06 20 | 21 | * Update to WordPress 4.7 22 | * Default `WP_ENV` to `production` instead of `development` ([#277](https://github.com/roots/bedrock/pull/277)) 23 | 24 | ### 1.7.2: 2016-09-07 25 | 26 | * Update to WordPress 4.6.1 27 | 28 | ### 1.7.1: 2016-08-16 29 | 30 | * Update to WordPress 4.6 31 | 32 | ### 1.7.0: 2016-07-10 33 | 34 | * Bump PHP requirement to >= 5.6 (5.5 is no longer supported) 35 | 36 | ### 1.6.4: 2016-06-21 37 | 38 | * Update to WordPress 4.5.3 39 | 40 | ### 1.6.3: 2016-05-06 41 | 42 | * Update to WordPress 4.5.2 43 | 44 | ### 1.6.2: 2016-04-26 45 | 46 | * Update to WordPress 4.5.1 47 | 48 | ### 1.6.1: 2016-04-12 49 | 50 | * Update to WordPress 4.5 51 | * Update coding standards (PSR-2) ([#244](https://github.com/roots/bedrock/pull/244)) 52 | 53 | ### 1.6.0: 2016-03-03 54 | 55 | * Add wp-password-bcrypt for more secure passwords ([#243](https://github.com/roots/bedrock/pull/243)) 56 | 57 | ### 1.5.4: 2016-02-29 58 | 59 | * Use HTTPS for wpackagist.org 60 | 61 | ### 1.5.3: 2016-02-03 62 | 63 | * Update to WordPress 4.4.2 64 | 65 | ### 1.5.2: 2016-02-01 66 | 67 | * Bump `composer/installers` dependency to 1.0.23 to fix deprecation notice 68 | 69 | ### 1.5.1: 2016-01-27 70 | 71 | * Use [oscarotero/env](https://github.com/oscarotero/env) instead of `getenv` ([#229](https://github.com/roots/bedrock/pull/233)) 72 | 73 | ### 1.5.0: 2016-01-17 74 | 75 | * Fix `DISABLE_WP_CRON` setting via ENV variable ([#229](https://github.com/roots/bedrock/pull/229)) 76 | * Set default `DB_CHARSET` to `utf8mb4` 77 | 78 | ### 1.4.7: 2016-01-07 79 | 80 | * Update to WordPress 4.4.1 81 | 82 | ### 1.4.6: 2015-12-09 83 | 84 | * Update to WordPress 4.4 85 | 86 | ### 1.4.5: 2015-09-16 87 | 88 | * Update to WordPress 4.3.1 89 | * Bump minimum required PHP version to 5.5 ([#201](https://github.com/roots/bedrock/pull/201)) 90 | 91 | ### 1.4.4: 2015-08-18 92 | 93 | * Update to WordPress 4.3 94 | 95 | ### 1.4.3: 2015-08-04 96 | 97 | * Update to WordPress 4.2.4 98 | 99 | ### 1.4.2: 2015-07-24 100 | 101 | * Update to WordPress 4.2.3 102 | 103 | ### 1.4.1: 2015-06-30 104 | 105 | * Dotenv 2.0.1 update 106 | 107 | ### 1.4.0: 2015-06-07 108 | 109 | * Removed .env generation script 110 | 111 | ### 1.3.7: 2015-05-07 112 | 113 | * Update to WordPress 4.2.2 114 | 115 | ### 1.3.6: 2015-04-27 116 | 117 | * Update to WordPress 4.2.1 118 | 119 | ### 1.3.5: 2015-04-23 120 | 121 | * Update to WordPress 4.2 122 | * Update to WordPress 4.1.2 123 | * Don't register theme directory if `WP_DEFAULT_THEME` is defined 124 | * Move Capistrano configs to https://github.com/roots/bedrock-capistrano 125 | 126 | ### 1.3.4: 2015-02-18 127 | 128 | * WordPress 4.1.1 fix 129 | 130 | ### 1.3.3: 2015-02-18 131 | 132 | * Update to WordPress 4.1.1 133 | * mu-plugins autoloader Multisite fix 134 | * Coding standards update + TravisCI integration 135 | 136 | ### 1.3.2: 2014-12-18 137 | 138 | * Update to WordPress 4.1 139 | * Remove WPLANG constant 140 | 141 | ### 1.3.1: 2014-11-28 142 | 143 | * Add Capistrano task to fix/update WP theme paths after deploys 144 | 145 | ### 1.3.0: 2014-11-20 146 | 147 | * Update to WordPress 4.0.1 148 | * Use johnpbloch/wordpress package instead of custom repository 149 | * Update default deploy.rb 150 | * Require PHP >= 5.4 in composer.json 151 | * Better PSR-1 adherence 152 | * Update phpdotenv dependency to 1.0.9 153 | * Fix Composer installer path plugin order 154 | * Add bedrock-autoloader mu-plugin 155 | 156 | ### 1.2.7: 2014-09-04 157 | 158 | * Update to WordPress 4.0 159 | 160 | ### 1.2.6: 2014-08-06 161 | 162 | * Update to WordPress 3.9.2 163 | * Minor deploy fix 164 | * Doc updates 165 | 166 | ### 1.2.5: 2014-07-16 167 | 168 | * Update to WordPress 3.9.1 169 | * Doc updates 170 | * Add `DB_PREFIX` constant 171 | * Update Gem versions 172 | * Disallow indexing in non-production environments 173 | 174 | ### 1.2.4: 2014-04-17 175 | 176 | * Fixes issue with 3.9 update (`composer.lock` wasn't updated) 177 | 178 | ### 1.2.3: 2014-04-16 179 | 180 | * Update to WordPress 3.9 181 | 182 | ### 1.2.2: 2014-04-14 183 | 184 | * Update to WordPress 3.8.3 185 | * Only run `Dotenv::load` if `.env` file exists 186 | 187 | ### 1.2.1: 2014-04-08 188 | 189 | * Update to WordPress 3.8.2 190 | 191 | ### 1.2.0: 2014-04-07 192 | 193 | * WP package now has `wordpress` vendor name: `wordpress/wordpress` 194 | * Remove wp-cli and add `wp-cli.yml` config 195 | 196 | ### 1.1.1: 2014-03-11 197 | 198 | * Update phpdotenv to 1.0.6 199 | * Update wp-cli to v0.14.1 200 | * Update README to refence new WordPress Packagist namespaces 201 | * Fix uploads path in `linked_dirs` for Capistrano deploys 202 | 203 | ### 1.1.0: 2014-03-01 204 | 205 | * Update to Capistrano 3.1.0: `deploy:restart` is no longer run by default 206 | * Better webroot structure: introduces the `/web` directory as the document/web root for web server vhosts 207 | 208 | ### 1.0.0: 2013-12-18 209 | 210 | * Initial release 211 | -------------------------------------------------------------------------------- /web/app/mu-plugins/bedrock-autoloader.php: -------------------------------------------------------------------------------- 1 | loadPlugins(); 64 | } 65 | 66 | /** 67 | * Run some checks then autoload our plugins. 68 | */ 69 | public function loadPlugins() 70 | { 71 | $this->checkCache(); 72 | $this->validatePlugins(); 73 | $this->countPlugins(); 74 | 75 | array_map(static function () { 76 | include_once(WPMU_PLUGIN_DIR . '/' . func_get_args()[0]); 77 | }, array_keys(self::$cache['plugins'])); 78 | 79 | $this->pluginHooks(); 80 | } 81 | 82 | /** 83 | * Filter show_advanced_plugins to display the autoloaded plugins. 84 | * @param $bool bool Whether to show the advanced plugins for the specified plugin type. 85 | * @param $type string The plugin type, i.e., `mustuse` or `dropins` 86 | * @return bool We return `false` to prevent WordPress from overriding our work 87 | * {@internal We add the plugin details ourselves, so we return false to disable the filter.} 88 | */ 89 | public function showInAdmin($show, $type) 90 | { 91 | $screen = get_current_screen(); 92 | $current = is_multisite() ? 'plugins-network' : 'plugins'; 93 | 94 | if ($screen->{'base'} != $current || $type != 'mustuse' || !current_user_can('activate_plugins')) { 95 | return $show; 96 | } 97 | 98 | $this->updateCache(); 99 | 100 | self::$auto_plugins = array_map(function ($auto_plugin) { 101 | $auto_plugin['Name'] .= ' *'; 102 | return $auto_plugin; 103 | }, self::$auto_plugins); 104 | 105 | $GLOBALS['plugins']['mustuse'] = array_unique(array_merge(self::$auto_plugins, self::$mu_plugins), SORT_REGULAR); 106 | 107 | return false; 108 | } 109 | 110 | /** 111 | * This sets the cache or calls for an update 112 | */ 113 | private function checkCache() 114 | { 115 | $cache = get_site_option('bedrock_autoloader'); 116 | 117 | if ($cache === false) { 118 | $this->updateCache(); 119 | return; 120 | } 121 | 122 | self::$cache = $cache; 123 | } 124 | 125 | /** 126 | * Get the plugins and mu-plugins from the mu-plugin path and remove duplicates. 127 | * Check cache against current plugins for newly activated plugins. 128 | * After that, we can update the cache. 129 | */ 130 | private function updateCache() 131 | { 132 | require_once(ABSPATH . 'wp-admin/includes/plugin.php'); 133 | 134 | self::$auto_plugins = get_plugins(self::$relative_path); 135 | self::$mu_plugins = get_mu_plugins(); 136 | $plugins = array_diff_key(self::$auto_plugins, self::$mu_plugins); 137 | $rebuild = !is_array(self::$cache['plugins']); 138 | self::$activated = ($rebuild) ? $plugins : array_diff_key($plugins, self::$cache['plugins']); 139 | self::$cache = array('plugins' => $plugins, 'count' => $this->countPlugins()); 140 | 141 | update_site_option('bedrock_autoloader', self::$cache); 142 | } 143 | 144 | /** 145 | * This accounts for the plugin hooks that would run if the plugins were 146 | * loaded as usual. Plugins are removed by deletion, so there's no way 147 | * to deactivate or uninstall. 148 | */ 149 | private function pluginHooks() 150 | { 151 | if (!is_array(self::$activated)) { 152 | return; 153 | } 154 | 155 | foreach (self::$activated as $plugin_file => $plugin_info) { 156 | do_action('activate_' . $plugin_file); 157 | } 158 | } 159 | 160 | /** 161 | * Check that the plugin file exists, if it doesn't update the cache. 162 | */ 163 | private function validatePlugins() 164 | { 165 | foreach (self::$cache['plugins'] as $plugin_file => $plugin_info) { 166 | if (!file_exists(WPMU_PLUGIN_DIR . '/' . $plugin_file)) { 167 | $this->updateCache(); 168 | break; 169 | } 170 | } 171 | } 172 | 173 | /** 174 | * Count the number of autoloaded plugins. 175 | * 176 | * Count our plugins (but only once) by counting the top level folders in the 177 | * mu-plugins dir. If it's more or less than last time, update the cache. 178 | * 179 | * @return int Number of autoloaded plugins. 180 | */ 181 | private function countPlugins() 182 | { 183 | if (isset(self::$count)) { 184 | return self::$count; 185 | } 186 | 187 | $count = count(glob(WPMU_PLUGIN_DIR . '/*/', GLOB_ONLYDIR | GLOB_NOSORT)); 188 | 189 | if (!isset(self::$cache['count']) || $count != self::$cache['count']) { 190 | self::$count = $count; 191 | $this->updateCache(); 192 | } 193 | 194 | return self::$count; 195 | } 196 | } 197 | 198 | new Autoloader(); 199 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "4a81ff4c54f8b2e8386ed9f0c2d5c688", 8 | "packages": [ 9 | { 10 | "name": "composer/installers", 11 | "version": "v1.2.0", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/composer/installers.git", 15 | "reference": "d78064c68299743e0161004f2de3a0204e33b804" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/composer/installers/zipball/d78064c68299743e0161004f2de3a0204e33b804", 20 | "reference": "d78064c68299743e0161004f2de3a0204e33b804", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "composer-plugin-api": "^1.0" 25 | }, 26 | "replace": { 27 | "roundcube/plugin-installer": "*", 28 | "shama/baton": "*" 29 | }, 30 | "require-dev": { 31 | "composer/composer": "1.0.*@dev", 32 | "phpunit/phpunit": "4.1.*" 33 | }, 34 | "type": "composer-plugin", 35 | "extra": { 36 | "class": "Composer\\Installers\\Plugin", 37 | "branch-alias": { 38 | "dev-master": "1.0-dev" 39 | } 40 | }, 41 | "autoload": { 42 | "psr-4": { 43 | "Composer\\Installers\\": "src/Composer/Installers" 44 | } 45 | }, 46 | "notification-url": "https://packagist.org/downloads/", 47 | "license": [ 48 | "MIT" 49 | ], 50 | "authors": [ 51 | { 52 | "name": "Kyle Robinson Young", 53 | "email": "kyle@dontkry.com", 54 | "homepage": "https://github.com/shama" 55 | } 56 | ], 57 | "description": "A multi-framework Composer library installer", 58 | "homepage": "https://composer.github.io/installers/", 59 | "keywords": [ 60 | "Craft", 61 | "Dolibarr", 62 | "Hurad", 63 | "ImageCMS", 64 | "MODX Evo", 65 | "Mautic", 66 | "OXID", 67 | "Plentymarkets", 68 | "RadPHP", 69 | "SMF", 70 | "Thelia", 71 | "WolfCMS", 72 | "agl", 73 | "aimeos", 74 | "annotatecms", 75 | "attogram", 76 | "bitrix", 77 | "cakephp", 78 | "chef", 79 | "cockpit", 80 | "codeigniter", 81 | "concrete5", 82 | "croogo", 83 | "dokuwiki", 84 | "drupal", 85 | "elgg", 86 | "expressionengine", 87 | "fuelphp", 88 | "grav", 89 | "installer", 90 | "joomla", 91 | "kohana", 92 | "laravel", 93 | "lithium", 94 | "magento", 95 | "mako", 96 | "mediawiki", 97 | "modulework", 98 | "moodle", 99 | "phpbb", 100 | "piwik", 101 | "ppi", 102 | "puppet", 103 | "reindex", 104 | "roundcube", 105 | "shopware", 106 | "silverstripe", 107 | "symfony", 108 | "typo3", 109 | "wordpress", 110 | "yawik", 111 | "zend", 112 | "zikula" 113 | ], 114 | "time": "2016-08-13T20:53:52+00:00" 115 | }, 116 | { 117 | "name": "johnpbloch/wordpress", 118 | "version": "4.7.4", 119 | "source": { 120 | "type": "git", 121 | "url": "https://github.com/johnpbloch/wordpress.git", 122 | "reference": "373c6caed518228364a8bc004ae05e877d74364a" 123 | }, 124 | "dist": { 125 | "type": "zip", 126 | "url": "https://api.github.com/repos/johnpbloch/wordpress/zipball/373c6caed518228364a8bc004ae05e877d74364a", 127 | "reference": "373c6caed518228364a8bc004ae05e877d74364a", 128 | "shasum": "" 129 | }, 130 | "require": { 131 | "johnpbloch/wordpress-core": "4.7.4", 132 | "johnpbloch/wordpress-core-installer": "~0.2", 133 | "php": ">=5.3.2" 134 | }, 135 | "type": "package", 136 | "notification-url": "https://packagist.org/downloads/", 137 | "license": [ 138 | "GPL-2.0+" 139 | ], 140 | "authors": [ 141 | { 142 | "name": "WordPress Community", 143 | "homepage": "http://wordpress.org/about/" 144 | } 145 | ], 146 | "description": "WordPress is web software you can use to create a beautiful website or blog.", 147 | "homepage": "http://wordpress.org/", 148 | "keywords": [ 149 | "blog", 150 | "cms", 151 | "wordpress" 152 | ], 153 | "time": "2017-04-20T20:49:27+00:00" 154 | }, 155 | { 156 | "name": "johnpbloch/wordpress-core", 157 | "version": "4.7.4", 158 | "source": { 159 | "type": "git", 160 | "url": "https://github.com/johnpbloch/wordpress-core.git", 161 | "reference": "46c55710c3f7aa99c6377151e626c98d7fb4b959" 162 | }, 163 | "dist": { 164 | "type": "zip", 165 | "url": "https://api.github.com/repos/johnpbloch/wordpress-core/zipball/46c55710c3f7aa99c6377151e626c98d7fb4b959", 166 | "reference": "46c55710c3f7aa99c6377151e626c98d7fb4b959", 167 | "shasum": "" 168 | }, 169 | "require": { 170 | "php": ">=5.3.2" 171 | }, 172 | "type": "wordpress-core", 173 | "notification-url": "https://packagist.org/downloads/", 174 | "license": [ 175 | "GPL-2.0+" 176 | ], 177 | "authors": [ 178 | { 179 | "name": "WordPress Community", 180 | "homepage": "http://wordpress.org/about/" 181 | } 182 | ], 183 | "description": "WordPress is web software you can use to create a beautiful website or blog.", 184 | "homepage": "http://wordpress.org/", 185 | "keywords": [ 186 | "blog", 187 | "cms", 188 | "wordpress" 189 | ], 190 | "time": "2017-04-20T19:59:59+00:00" 191 | }, 192 | { 193 | "name": "johnpbloch/wordpress-core-installer", 194 | "version": "0.2.1", 195 | "source": { 196 | "type": "git", 197 | "url": "https://github.com/johnpbloch/wordpress-core-installer.git", 198 | "reference": "a04c2c383ef13aae077f36799ed2eafdebd618d2" 199 | }, 200 | "dist": { 201 | "type": "zip", 202 | "url": "https://api.github.com/repos/johnpbloch/wordpress-core-installer/zipball/a04c2c383ef13aae077f36799ed2eafdebd618d2", 203 | "reference": "a04c2c383ef13aae077f36799ed2eafdebd618d2", 204 | "shasum": "" 205 | }, 206 | "require": { 207 | "composer-plugin-api": "^1.0" 208 | }, 209 | "conflict": { 210 | "composer/installers": "<1.0.6" 211 | }, 212 | "require-dev": { 213 | "composer/composer": "1.0.*@dev" 214 | }, 215 | "type": "composer-plugin", 216 | "extra": { 217 | "class": "johnpbloch\\Composer\\WordPressCorePlugin" 218 | }, 219 | "autoload": { 220 | "psr-0": { 221 | "johnpbloch\\Composer\\": "src/" 222 | } 223 | }, 224 | "notification-url": "https://packagist.org/downloads/", 225 | "license": [ 226 | "GPL-2.0+" 227 | ], 228 | "authors": [ 229 | { 230 | "name": "John P. Bloch", 231 | "email": "me@johnpbloch.com" 232 | } 233 | ], 234 | "description": "A custom installer to handle deploying WordPress with composer", 235 | "keywords": [ 236 | "wordpress" 237 | ], 238 | "time": "2015-06-11T15:15:30+00:00" 239 | }, 240 | { 241 | "name": "oscarotero/env", 242 | "version": "v1.0.2", 243 | "source": { 244 | "type": "git", 245 | "url": "https://github.com/oscarotero/env.git", 246 | "reference": "0819fd764ca19ab880b8d9ed7a95ae4910f98f20" 247 | }, 248 | "dist": { 249 | "type": "zip", 250 | "url": "https://api.github.com/repos/oscarotero/env/zipball/0819fd764ca19ab880b8d9ed7a95ae4910f98f20", 251 | "reference": "0819fd764ca19ab880b8d9ed7a95ae4910f98f20", 252 | "shasum": "" 253 | }, 254 | "require": { 255 | "php": ">=5.2" 256 | }, 257 | "type": "library", 258 | "autoload": { 259 | "psr-0": { 260 | "Env": "src/" 261 | } 262 | }, 263 | "notification-url": "https://packagist.org/downloads/", 264 | "license": [ 265 | "MIT" 266 | ], 267 | "authors": [ 268 | { 269 | "name": "Oscar Otero", 270 | "email": "oom@oscarotero.com", 271 | "homepage": "http://oscarotero.com", 272 | "role": "Developer" 273 | } 274 | ], 275 | "description": "Simple library to consume environment variables", 276 | "homepage": "https://github.com/oscarotero/env", 277 | "keywords": [ 278 | "env" 279 | ], 280 | "time": "2016-05-08T17:14:32+00:00" 281 | }, 282 | { 283 | "name": "outlandish/oowp", 284 | "version": "2.0.2", 285 | "source": { 286 | "type": "git", 287 | "url": "https://github.com/outlandishideas/oowp.git", 288 | "reference": "347244141919c9c819c4e993bc5601806a06d431" 289 | }, 290 | "dist": { 291 | "type": "zip", 292 | "url": "https://api.github.com/repos/outlandishideas/oowp/zipball/347244141919c9c819c4e993bc5601806a06d431", 293 | "reference": "347244141919c9c819c4e993bc5601806a06d431", 294 | "shasum": "" 295 | }, 296 | "require": { 297 | "composer/installers": "~1.0" 298 | }, 299 | "type": "wordpress-muplugin", 300 | "autoload": { 301 | "psr-4": { 302 | "Outlandish\\Wordpress\\Oowp\\": "src/" 303 | } 304 | }, 305 | "license": [ 306 | "GPL-3.0" 307 | ], 308 | "authors": [ 309 | { 310 | "name": "Rasmus Winter", 311 | "email": "ras@outlandish.com" 312 | }, 313 | { 314 | "name": "Tamlyn Rhodes", 315 | "email": "tam@outlandish.com" 316 | }, 317 | { 318 | "name": "Harry Robbins", 319 | "email": "harry@outlandish.com" 320 | } 321 | ], 322 | "description": "A plugin for WordPress that makes post types easier to manage", 323 | "support": { 324 | "source": "https://github.com/outlandishideas/oowp/tree/2.0.2", 325 | "issues": "https://github.com/outlandishideas/oowp/issues" 326 | }, 327 | "time": "2017-04-24T17:16:41+00:00" 328 | }, 329 | { 330 | "name": "roots/wp-password-bcrypt", 331 | "version": "1.0.0", 332 | "source": { 333 | "type": "git", 334 | "url": "https://github.com/roots/wp-password-bcrypt.git", 335 | "reference": "5cecd2e98ccc3193443cc5c5db9b3bc7abed5ffa" 336 | }, 337 | "dist": { 338 | "type": "zip", 339 | "url": "https://api.github.com/repos/roots/wp-password-bcrypt/zipball/5cecd2e98ccc3193443cc5c5db9b3bc7abed5ffa", 340 | "reference": "5cecd2e98ccc3193443cc5c5db9b3bc7abed5ffa", 341 | "shasum": "" 342 | }, 343 | "require": { 344 | "composer/installers": "~1.0", 345 | "php": ">=5.5.0" 346 | }, 347 | "require-dev": { 348 | "brain/monkey": "^1.3.1", 349 | "mockery/mockery": "^0.9.4", 350 | "phpunit/phpunit": "^4.8.23|^5.2.9", 351 | "squizlabs/php_codesniffer": "^2.5.1" 352 | }, 353 | "type": "library", 354 | "autoload": { 355 | "files": [ 356 | "wp-password-bcrypt.php" 357 | ] 358 | }, 359 | "notification-url": "https://packagist.org/downloads/", 360 | "license": [ 361 | "MIT" 362 | ], 363 | "authors": [ 364 | { 365 | "name": "Scott Walkinshaw", 366 | "email": "scott.walkinshaw@gmail.com", 367 | "homepage": "https://github.com/swalkinshaw" 368 | }, 369 | { 370 | "name": "qwp6t", 371 | "homepage": "https://github.com/qwp6t" 372 | }, 373 | { 374 | "name": "Jan Pingel", 375 | "email": "jpingel@bitpiston.com", 376 | "homepage": "http://janpingel.com" 377 | } 378 | ], 379 | "description": "WordPress plugin which replaces wp_hash_password and wp_check_password's phpass hasher with PHP 5.5's password_hash and password_verify using bcrypt.", 380 | "homepage": "https://roots.io/plugins/wp-password-bcrypt", 381 | "keywords": [ 382 | "wordpress wp bcrypt password" 383 | ], 384 | "time": "2016-03-01T16:27:06+00:00" 385 | }, 386 | { 387 | "name": "vlucas/phpdotenv", 388 | "version": "v2.4.0", 389 | "source": { 390 | "type": "git", 391 | "url": "https://github.com/vlucas/phpdotenv.git", 392 | "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c" 393 | }, 394 | "dist": { 395 | "type": "zip", 396 | "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", 397 | "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", 398 | "shasum": "" 399 | }, 400 | "require": { 401 | "php": ">=5.3.9" 402 | }, 403 | "require-dev": { 404 | "phpunit/phpunit": "^4.8 || ^5.0" 405 | }, 406 | "type": "library", 407 | "extra": { 408 | "branch-alias": { 409 | "dev-master": "2.4-dev" 410 | } 411 | }, 412 | "autoload": { 413 | "psr-4": { 414 | "Dotenv\\": "src/" 415 | } 416 | }, 417 | "notification-url": "https://packagist.org/downloads/", 418 | "license": [ 419 | "BSD-3-Clause-Attribution" 420 | ], 421 | "authors": [ 422 | { 423 | "name": "Vance Lucas", 424 | "email": "vance@vancelucas.com", 425 | "homepage": "http://www.vancelucas.com" 426 | } 427 | ], 428 | "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", 429 | "keywords": [ 430 | "dotenv", 431 | "env", 432 | "environment" 433 | ], 434 | "time": "2016-09-01T10:05:43+00:00" 435 | }, 436 | { 437 | "name": "wpackagist-plugin/advanced-custom-fields", 438 | "version": "4.4.11", 439 | "source": { 440 | "type": "svn", 441 | "url": "https://plugins.svn.wordpress.org/advanced-custom-fields/", 442 | "reference": "tags/4.4.11" 443 | }, 444 | "dist": { 445 | "type": "zip", 446 | "url": "https://downloads.wordpress.org/plugin/advanced-custom-fields.4.4.11.zip", 447 | "reference": "tags/4.4.11", 448 | "shasum": null 449 | }, 450 | "require": { 451 | "composer/installers": "~1.0" 452 | }, 453 | "type": "wordpress-plugin", 454 | "homepage": "https://wordpress.org/plugins/advanced-custom-fields/" 455 | }, 456 | { 457 | "name": "wpackagist-plugin/posts-to-posts", 458 | "version": "1.6.5", 459 | "source": { 460 | "type": "svn", 461 | "url": "https://plugins.svn.wordpress.org/posts-to-posts/", 462 | "reference": "tags/1.6.5" 463 | }, 464 | "dist": { 465 | "type": "zip", 466 | "url": "https://downloads.wordpress.org/plugin/posts-to-posts.1.6.5.zip", 467 | "reference": "tags/1.6.5", 468 | "shasum": null 469 | }, 470 | "require": { 471 | "composer/installers": "~1.0" 472 | }, 473 | "type": "wordpress-plugin", 474 | "homepage": "https://wordpress.org/plugins/posts-to-posts/" 475 | } 476 | ], 477 | "packages-dev": [], 478 | "aliases": [], 479 | "minimum-stability": "stable", 480 | "stability-flags": [], 481 | "prefer-stable": false, 482 | "prefer-lowest": false, 483 | "platform": { 484 | "php": ">=5.6" 485 | }, 486 | "platform-dev": [] 487 | } 488 | --------------------------------------------------------------------------------