Changeset 1843050
- Timestamp:
- 03/19/2018 07:44:29 PM (8 years ago)
- Location:
- fv-community-news
- Files:
-
- 20 added
- 3 deleted
- 8 edited
- 43 copied
-
tags/3.2.2 (copied) (copied from fv-community-news/trunk)
-
tags/3.2.2/config/default.config.php (copied) (copied from fv-community-news/trunk/config/default.config.php) (1 diff)
-
tags/3.2.2/config/services.config.php (copied) (copied from fv-community-news/trunk/config/services.config.php) (4 diffs)
-
tags/3.2.2/fv-community-news.php (copied) (copied from fv-community-news/trunk/fv-community-news.php) (1 diff)
-
tags/3.2.2/fvcn-includes (deleted)
-
tags/3.2.2/fvcn-theme/fvcn/form-post.php (copied) (copied from fv-community-news/trunk/fvcn-theme/fvcn/form-post.php)
-
tags/3.2.2/fvcn-theme/single-fvcn.php (copied) (copied from fv-community-news/trunk/fvcn-theme/single-fvcn.php)
-
tags/3.2.2/fvcn-theme/taxonomy-fvcn.php (copied) (copied from fv-community-news/trunk/fvcn-theme/taxonomy-fvcn.php)
-
tags/3.2.2/public/images/menu-old.png (deleted)
-
tags/3.2.2/public/images/[email protected] (deleted)
-
tags/3.2.2/public/js/dashboard.js (copied) (copied from fv-community-news/trunk/public/js/dashboard.js)
-
tags/3.2.2/readme.txt (copied) (copied from fv-community-news/trunk/readme.txt) (2 diffs)
-
tags/3.2.2/src/Admin/Admin.php (copied) (copied from fv-community-news/trunk/src/Admin/Admin.php)
-
tags/3.2.2/src/Admin/Dashboard/Widget/RecentPosts.php (copied) (copied from fv-community-news/trunk/src/Admin/Dashboard/Widget/RecentPosts.php)
-
tags/3.2.2/src/Admin/Post/Moderation.php (copied) (copied from fv-community-news/trunk/src/Admin/Post/Moderation.php)
-
tags/3.2.2/src/Admin/Settings/AbstractSettings.php (copied) (copied from fv-community-news/trunk/src/Admin/Settings/AbstractSettings.php)
-
tags/3.2.2/src/Admin/Settings/Form.php (copied) (copied from fv-community-news/trunk/src/Admin/Settings/Form.php)
-
tags/3.2.2/src/Admin/Settings/Settings.php (copied) (copied from fv-community-news/trunk/src/Admin/Settings/Settings.php)
-
tags/3.2.2/src/Config/AbstractConfig.php (copied) (copied from fv-community-news/trunk/src/Config/AbstractConfig.php)
-
tags/3.2.2/src/Config/Memory.php (copied) (copied from fv-community-news/trunk/src/Config/Memory.php)
-
tags/3.2.2/src/Config/WordPress.php (copied) (copied from fv-community-news/trunk/src/Config/WordPress.php)
-
tags/3.2.2/src/Container/Container.php (copied) (copied from fv-community-news/trunk/src/Container/Container.php)
-
tags/3.2.2/src/Factory/Hook/Controller.php (copied) (copied from fv-community-news/trunk/src/Factory/Hook/Controller.php)
-
tags/3.2.2/src/Factory/Hook/Syncer.php (added)
-
tags/3.2.2/src/Factory/Post (copied) (copied from fv-community-news/trunk/src/Factory/Post)
-
tags/3.2.2/src/Factory/Syncer (added)
-
tags/3.2.2/src/Factory/Syncer/Syncer.php (added)
-
tags/3.2.2/src/Factory/View/AjaxForm.php (copied) (copied from fv-community-news/trunk/src/Factory/View/AjaxForm.php)
-
tags/3.2.2/src/Hook/Akismet.php (copied) (copied from fv-community-news/trunk/src/Hook/Akismet.php)
-
tags/3.2.2/src/Hook/Collection.php (copied) (copied from fv-community-news/trunk/src/Hook/Collection.php) (1 diff)
-
tags/3.2.2/src/Hook/Controller.php (copied) (copied from fv-community-news/trunk/src/Hook/Controller.php)
-
tags/3.2.2/src/Hook/EnqueueScripts.php (copied) (copied from fv-community-news/trunk/src/Hook/EnqueueScripts.php)
-
tags/3.2.2/src/Hook/Head.php (copied) (copied from fv-community-news/trunk/src/Hook/Head.php)
-
tags/3.2.2/src/Hook/HookInterface.php (copied) (copied from fv-community-news/trunk/src/Hook/HookInterface.php)
-
tags/3.2.2/src/Hook/Init.php (copied) (copied from fv-community-news/trunk/src/Hook/Init.php)
-
tags/3.2.2/src/Hook/Syncer.php (added)
-
tags/3.2.2/src/Hook/WidgetsInit.php (copied) (copied from fv-community-news/trunk/src/Hook/WidgetsInit.php)
-
tags/3.2.2/src/Post/Controller.php (copied) (copied from fv-community-news/trunk/src/Post/Controller.php)
-
tags/3.2.2/src/Post/Form.php (copied) (copied from fv-community-news/trunk/src/Post/Form.php)
-
tags/3.2.2/src/Post/Mapper.php (copied) (copied from fv-community-news/trunk/src/Post/Mapper.php)
-
tags/3.2.2/src/Syncer (added)
-
tags/3.2.2/src/Syncer/Api (added)
-
tags/3.2.2/src/Syncer/Api/Api.php (added)
-
tags/3.2.2/src/Syncer/Api/Exception.php (added)
-
tags/3.2.2/src/Syncer/Api/Request.php (added)
-
tags/3.2.2/src/Syncer/Syncer.php (added)
-
tags/3.2.2/src/Template/common-functions.php (copied) (copied from fv-community-news/trunk/src/Template/common-functions.php) (1 diff)
-
tags/3.2.2/src/Template/fvcn-core-theme.php (copied) (copied from fv-community-news/trunk/src/Template/fvcn-core-theme.php)
-
tags/3.2.2/src/Template/options-functions.php (copied) (copied from fv-community-news/trunk/src/Template/options-functions.php)
-
tags/3.2.2/src/Template/post-functions.php (copied) (copied from fv-community-news/trunk/src/Template/post-functions.php)
-
tags/3.2.2/src/Template/tag-functions.php (copied) (copied from fv-community-news/trunk/src/Template/tag-functions.php)
-
tags/3.2.2/src/Template/user-functions.php (copied) (copied from fv-community-news/trunk/src/Template/user-functions.php)
-
tags/3.2.2/src/Validator/NotEmpty.php (copied) (copied from fv-community-news/trunk/src/Validator/NotEmpty.php)
-
tags/3.2.2/src/Validator/ValidatorChain.php (copied) (copied from fv-community-news/trunk/src/Validator/ValidatorChain.php)
-
tags/3.2.2/src/Version.php (modified) (4 diffs)
-
tags/3.2.2/src/View/AjaxForm.php (copied) (copied from fv-community-news/trunk/src/View/AjaxForm.php)
-
tags/3.2.2/src/Widget/ListPosts.php (copied) (copied from fv-community-news/trunk/src/Widget/ListPosts.php)
-
trunk/config/default.config.php (modified) (1 diff)
-
trunk/config/services.config.php (modified) (4 diffs)
-
trunk/fv-community-news.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/Factory/Hook/Syncer.php (added)
-
trunk/src/Factory/Syncer (added)
-
trunk/src/Factory/Syncer/Syncer.php (added)
-
trunk/src/Hook/Collection.php (modified) (1 diff)
-
trunk/src/Hook/Syncer.php (added)
-
trunk/src/Syncer (added)
-
trunk/src/Syncer/Api (added)
-
trunk/src/Syncer/Api/Api.php (added)
-
trunk/src/Syncer/Api/Exception.php (added)
-
trunk/src/Syncer/Api/Request.php (added)
-
trunk/src/Syncer/Syncer.php (added)
-
trunk/src/Template/common-functions.php (modified) (1 diff)
-
trunk/src/Version.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fv-community-news/tags/3.2.2/config/default.config.php
r1810381 r1843050 31 31 */ 32 32 '_fvcn_is_anonymous_allowed' => true, 33 34 /** 35 * @var bool Whether syncing posts to the API is enabled 36 */ 37 '_fvcn_syncer_enabled' => true, 33 38 34 39 /** -
fv-community-news/tags/3.2.2/config/services.config.php
r1810381 r1843050 20 20 use FvCommunityNews\Factory\Hook\EnqueueScripts as EnqueueScriptsHookFactory; 21 21 use FvCommunityNews\Factory\Hook\Init as InitHookFactory; 22 use FvCommunityNews\Factory\Hook\Syncer as SyncerHookFactory; 22 23 use FvCommunityNews\Factory\Post\Controller as PostControllerFactory; 23 24 use FvCommunityNews\Factory\Post\Form as PostFormFactory; 25 use FvCommunityNews\Factory\Syncer\Syncer as SyncerFactory; 24 26 use FvCommunityNews\Factory\View\AjaxForm as AjaxFormFactory; 25 27 use FvCommunityNews\Hook\Akismet as AkismetHook; … … 28 30 use FvCommunityNews\Hook\Head as HeadHook; 29 31 use FvCommunityNews\Hook\Init as InitHook; 32 use FvCommunityNews\Hook\Syncer as SyncerHook; 30 33 use FvCommunityNews\Hook\WidgetsInit as WidgetsInitHook; 31 34 use FvCommunityNews\Post\Controller as PostController; 32 35 use FvCommunityNews\Post\Mapper as PostMapper; 33 36 use FvCommunityNews\Post\Form as PostForm; 37 use FvCommunityNews\Syncer\Syncer; 34 38 use FvCommunityNews\View\AjaxForm; 35 39 … … 49 53 AkismetHandler::class => AkismetHandlerFactory::class, 50 54 55 Syncer::class => SyncerFactory::class, 56 51 57 AkismetHook::class => AkismetHookFactory::class, 52 58 EnqueueScriptsHook::class => EnqueueScriptsHookFactory::class, … … 54 60 InitHook::class => InitHookFactory::class, 55 61 PostControllerHook::class => PostControllerHookFactory::class, 62 SyncerHook::class => SyncerHookFactory::class, 56 63 WidgetsInitHook::class => InvokableFactory::class, 57 64 -
fv-community-news/tags/3.2.2/fv-community-news.php
r1825546 r1843050 5 5 * Plugin URI: https://frankverhoeven.me/wordpress-plugin-fv-community-news/ 6 6 * Description: Allow visitors of your site to submit articles. 7 * Version: 3.2. 17 * Version: 3.2.2 8 8 * Author: Frank Verhoeven 9 9 * Author URI: https://frankverhoeven.me/ -
fv-community-news/tags/3.2.2/readme.txt
r1825546 r1843050 6 6 Requires at least: 4.8 7 7 Tested up to: 4.9 8 Stable tag: 3.2. 18 Stable tag: 3.2.2 9 9 10 10 Give the visitors of your site the ability to submit their news to you, and list it in a nice news feed. … … 134 134 135 135 136 = 3.2.2 = 137 138 * Fix: Various bugfixes & improvements. 139 140 136 141 = 3.2.1 = 137 142 138 * Fix: PHP 7.0 Compatiblity 143 * Fix: PHP 7.0 Compatiblity. 139 144 140 145 -
fv-community-news/tags/3.2.2/src/Hook/Collection.php
r1825546 r1843050 52 52 'fvcn_ready' => [ 53 53 Akismet::class, 54 Syncer::class, 54 55 ], 55 56 ]; -
fv-community-news/tags/3.2.2/src/Template/common-functions.php
r1810381 r1843050 198 198 199 199 $id = (int) fvcn_get_post_id(); 200 if (isset($_COOKIE['fvcn_post_viewed_' . $id . '_' . COOKIEHASH])) {201 return $template;202 }203 200 204 201 $postMapper = fvcn_container_get(\FvCommunityNews\Post\Mapper::class); 205 202 $postMapper->increasePostViewCount($id); 206 203 207 setcookie('fvcn_post_viewed_' . $id . '_' . COOKIEHASH, 'true', 0, COOKIEPATH, COOKIE_DOMAIN);208 209 204 return $template; 210 205 } -
fv-community-news/tags/3.2.2/src/Version.php
r1806332 r1843050 4 4 5 5 use FvCommunityNews; 6 use FvCommunityNews\Syncer\Api\Api; 7 use FvCommunityNews\Syncer\Api\Exception as ApiException; 8 use FvCommunityNews\Syncer\Api\Request as ApiRequest; 6 9 7 10 /** … … 15 18 * @var string 16 19 */ 17 const CURRENT_VERSION = FvCommunityNews::VERSION; 18 /** 19 * @var string 20 */ 21 const API_VERSION_CURRENT = 'https://api.frankverhoeven.me/fvcn/1.0/versions/current'; 22 /** 23 * @var string 24 */ 25 private static $latestVersion = null; 20 private static $latestVersion; 26 21 27 22 /** … … 32 27 public static function getCurrentVersion() 33 28 { 34 return self::CURRENT_VERSION;29 return FvCommunityNews::VERSION; 35 30 } 36 31 … … 42 37 public static function getLatestVersion() 43 38 { 44 global $wp_version; 39 if (null === self::$latestVersion) { 40 $apiRequest = new ApiRequest(Api::latestVersion()); 41 42 try { 43 $response = $apiRequest->execute([ 44 'blog_name' => \get_bloginfo('name'), 45 'blog_description' => \get_bloginfo('description'), 46 'blog_url' => \get_bloginfo('url'), 47 'wordpress_url' => \get_bloginfo('wpurl'), 48 'wordpress_version' => \get_bloginfo('version'), 49 'plugin_version' => self::getCurrentVersion(), 50 'php_version' => \phpversion(), 51 ]); 52 } catch (ApiException $e) { 53 $response = null; 54 } 45 55 46 if (null === self::$latestVersion) { 47 $response = wp_remote_get(self::API_VERSION_CURRENT, [ 48 'body' => [ 49 'blog_name' => get_bloginfo('name'), 50 'blog_description' => get_bloginfo('description'), 51 'blog_url' => get_bloginfo('url'), 52 'wordpress_url' => get_bloginfo('wpurl'), 53 'wordpress_version' => $wp_version, 54 'plugin_version' => self::getCurrentVersion(), 55 'php_version' => phpversion(), 56 ], 57 ]); 58 59 if (is_array($response) && 200 == $response['response']['code']) { 60 $data = json_decode($response['body'], true); 56 if (\is_array($response) && 200 == $response['response']['code']) { 57 $data = \json_decode($response['body'], true); 61 58 self::$latestVersion = $data['version']; 62 59 } -
fv-community-news/trunk/config/default.config.php
r1810381 r1843050 31 31 */ 32 32 '_fvcn_is_anonymous_allowed' => true, 33 34 /** 35 * @var bool Whether syncing posts to the API is enabled 36 */ 37 '_fvcn_syncer_enabled' => true, 33 38 34 39 /** -
fv-community-news/trunk/config/services.config.php
r1810381 r1843050 20 20 use FvCommunityNews\Factory\Hook\EnqueueScripts as EnqueueScriptsHookFactory; 21 21 use FvCommunityNews\Factory\Hook\Init as InitHookFactory; 22 use FvCommunityNews\Factory\Hook\Syncer as SyncerHookFactory; 22 23 use FvCommunityNews\Factory\Post\Controller as PostControllerFactory; 23 24 use FvCommunityNews\Factory\Post\Form as PostFormFactory; 25 use FvCommunityNews\Factory\Syncer\Syncer as SyncerFactory; 24 26 use FvCommunityNews\Factory\View\AjaxForm as AjaxFormFactory; 25 27 use FvCommunityNews\Hook\Akismet as AkismetHook; … … 28 30 use FvCommunityNews\Hook\Head as HeadHook; 29 31 use FvCommunityNews\Hook\Init as InitHook; 32 use FvCommunityNews\Hook\Syncer as SyncerHook; 30 33 use FvCommunityNews\Hook\WidgetsInit as WidgetsInitHook; 31 34 use FvCommunityNews\Post\Controller as PostController; 32 35 use FvCommunityNews\Post\Mapper as PostMapper; 33 36 use FvCommunityNews\Post\Form as PostForm; 37 use FvCommunityNews\Syncer\Syncer; 34 38 use FvCommunityNews\View\AjaxForm; 35 39 … … 49 53 AkismetHandler::class => AkismetHandlerFactory::class, 50 54 55 Syncer::class => SyncerFactory::class, 56 51 57 AkismetHook::class => AkismetHookFactory::class, 52 58 EnqueueScriptsHook::class => EnqueueScriptsHookFactory::class, … … 54 60 InitHook::class => InitHookFactory::class, 55 61 PostControllerHook::class => PostControllerHookFactory::class, 62 SyncerHook::class => SyncerHookFactory::class, 56 63 WidgetsInitHook::class => InvokableFactory::class, 57 64 -
fv-community-news/trunk/fv-community-news.php
r1825546 r1843050 5 5 * Plugin URI: https://frankverhoeven.me/wordpress-plugin-fv-community-news/ 6 6 * Description: Allow visitors of your site to submit articles. 7 * Version: 3.2. 17 * Version: 3.2.2 8 8 * Author: Frank Verhoeven 9 9 * Author URI: https://frankverhoeven.me/ -
fv-community-news/trunk/readme.txt
r1825546 r1843050 6 6 Requires at least: 4.8 7 7 Tested up to: 4.9 8 Stable tag: 3.2. 18 Stable tag: 3.2.2 9 9 10 10 Give the visitors of your site the ability to submit their news to you, and list it in a nice news feed. … … 134 134 135 135 136 = 3.2.2 = 137 138 * Fix: Various bugfixes & improvements. 139 140 136 141 = 3.2.1 = 137 142 138 * Fix: PHP 7.0 Compatiblity 143 * Fix: PHP 7.0 Compatiblity. 139 144 140 145 -
fv-community-news/trunk/src/Hook/Collection.php
r1825546 r1843050 52 52 'fvcn_ready' => [ 53 53 Akismet::class, 54 Syncer::class, 54 55 ], 55 56 ]; -
fv-community-news/trunk/src/Template/common-functions.php
r1810381 r1843050 198 198 199 199 $id = (int) fvcn_get_post_id(); 200 if (isset($_COOKIE['fvcn_post_viewed_' . $id . '_' . COOKIEHASH])) {201 return $template;202 }203 200 204 201 $postMapper = fvcn_container_get(\FvCommunityNews\Post\Mapper::class); 205 202 $postMapper->increasePostViewCount($id); 206 203 207 setcookie('fvcn_post_viewed_' . $id . '_' . COOKIEHASH, 'true', 0, COOKIEPATH, COOKIE_DOMAIN);208 209 204 return $template; 210 205 } -
fv-community-news/trunk/src/Version.php
r1806332 r1843050 4 4 5 5 use FvCommunityNews; 6 use FvCommunityNews\Syncer\Api\Api; 7 use FvCommunityNews\Syncer\Api\Exception as ApiException; 8 use FvCommunityNews\Syncer\Api\Request as ApiRequest; 6 9 7 10 /** … … 15 18 * @var string 16 19 */ 17 const CURRENT_VERSION = FvCommunityNews::VERSION; 18 /** 19 * @var string 20 */ 21 const API_VERSION_CURRENT = 'https://api.frankverhoeven.me/fvcn/1.0/versions/current'; 22 /** 23 * @var string 24 */ 25 private static $latestVersion = null; 20 private static $latestVersion; 26 21 27 22 /** … … 32 27 public static function getCurrentVersion() 33 28 { 34 return self::CURRENT_VERSION;29 return FvCommunityNews::VERSION; 35 30 } 36 31 … … 42 37 public static function getLatestVersion() 43 38 { 44 global $wp_version; 39 if (null === self::$latestVersion) { 40 $apiRequest = new ApiRequest(Api::latestVersion()); 41 42 try { 43 $response = $apiRequest->execute([ 44 'blog_name' => \get_bloginfo('name'), 45 'blog_description' => \get_bloginfo('description'), 46 'blog_url' => \get_bloginfo('url'), 47 'wordpress_url' => \get_bloginfo('wpurl'), 48 'wordpress_version' => \get_bloginfo('version'), 49 'plugin_version' => self::getCurrentVersion(), 50 'php_version' => \phpversion(), 51 ]); 52 } catch (ApiException $e) { 53 $response = null; 54 } 45 55 46 if (null === self::$latestVersion) { 47 $response = wp_remote_get(self::API_VERSION_CURRENT, [ 48 'body' => [ 49 'blog_name' => get_bloginfo('name'), 50 'blog_description' => get_bloginfo('description'), 51 'blog_url' => get_bloginfo('url'), 52 'wordpress_url' => get_bloginfo('wpurl'), 53 'wordpress_version' => $wp_version, 54 'plugin_version' => self::getCurrentVersion(), 55 'php_version' => phpversion(), 56 ], 57 ]); 58 59 if (is_array($response) && 200 == $response['response']['code']) { 60 $data = json_decode($response['body'], true); 56 if (\is_array($response) && 200 == $response['response']['code']) { 57 $data = \json_decode($response['body'], true); 61 58 self::$latestVersion = $data['version']; 62 59 }
Note: See TracChangeset
for help on using the changeset viewer.