Plugin Directory

Changeset 1843050


Ignore:
Timestamp:
03/19/2018 07:44:29 PM (8 years ago)
Author:
frankverhoeven
Message:

Push 3.2.2

Location:
fv-community-news
Files:
20 added
3 deleted
8 edited
43 copied

Legend:

Unmodified
Added
Removed
  • fv-community-news/tags/3.2.2/config/default.config.php

    r1810381 r1843050  
    3131     */
    3232    '_fvcn_is_anonymous_allowed' => true,
     33
     34    /**
     35     * @var bool Whether syncing posts to the API is enabled
     36     */
     37    '_fvcn_syncer_enabled' => true,
    3338
    3439    /**
  • fv-community-news/tags/3.2.2/config/services.config.php

    r1810381 r1843050  
    2020use FvCommunityNews\Factory\Hook\EnqueueScripts as EnqueueScriptsHookFactory;
    2121use FvCommunityNews\Factory\Hook\Init as InitHookFactory;
     22use FvCommunityNews\Factory\Hook\Syncer as SyncerHookFactory;
    2223use FvCommunityNews\Factory\Post\Controller as PostControllerFactory;
    2324use FvCommunityNews\Factory\Post\Form as PostFormFactory;
     25use FvCommunityNews\Factory\Syncer\Syncer as SyncerFactory;
    2426use FvCommunityNews\Factory\View\AjaxForm as AjaxFormFactory;
    2527use FvCommunityNews\Hook\Akismet as AkismetHook;
     
    2830use FvCommunityNews\Hook\Head as HeadHook;
    2931use FvCommunityNews\Hook\Init as InitHook;
     32use FvCommunityNews\Hook\Syncer as SyncerHook;
    3033use FvCommunityNews\Hook\WidgetsInit as WidgetsInitHook;
    3134use FvCommunityNews\Post\Controller as PostController;
    3235use FvCommunityNews\Post\Mapper as PostMapper;
    3336use FvCommunityNews\Post\Form as PostForm;
     37use FvCommunityNews\Syncer\Syncer;
    3438use FvCommunityNews\View\AjaxForm;
    3539
     
    4953    AkismetHandler::class       => AkismetHandlerFactory::class,
    5054
     55    Syncer::class               => SyncerFactory::class,
     56
    5157    AkismetHook::class          => AkismetHookFactory::class,
    5258    EnqueueScriptsHook::class   => EnqueueScriptsHookFactory::class,
     
    5460    InitHook::class             => InitHookFactory::class,
    5561    PostControllerHook::class   => PostControllerHookFactory::class,
     62    SyncerHook::class           => SyncerHookFactory::class,
    5663    WidgetsInitHook::class      => InvokableFactory::class,
    5764
  • fv-community-news/tags/3.2.2/fv-community-news.php

    r1825546 r1843050  
    55 * Plugin URI:  https://frankverhoeven.me/wordpress-plugin-fv-community-news/
    66 * Description: Allow visitors of your site to submit articles.
    7  * Version:     3.2.1
     7 * Version:     3.2.2
    88 * Author:      Frank Verhoeven
    99 * Author URI:  https://frankverhoeven.me/
  • fv-community-news/tags/3.2.2/readme.txt

    r1825546 r1843050  
    66Requires at least:  4.8
    77Tested up to:       4.9
    8 Stable tag:         3.2.1
     8Stable tag:         3.2.2
    99
    1010Give the visitors of your site the ability to submit their news to you, and list it in a nice news feed.
     
    134134
    135135
     136= 3.2.2 =
     137
     138* Fix: Various bugfixes & improvements.
     139
     140
    136141= 3.2.1 =
    137142
    138 * Fix: PHP 7.0 Compatiblity
     143* Fix: PHP 7.0 Compatiblity.
    139144
    140145
  • fv-community-news/tags/3.2.2/src/Hook/Collection.php

    r1825546 r1843050  
    5252        'fvcn_ready' => [
    5353            Akismet::class,
     54            Syncer::class,
    5455        ],
    5556    ];
  • fv-community-news/tags/3.2.2/src/Template/common-functions.php

    r1810381 r1843050  
    198198
    199199    $id = (int) fvcn_get_post_id();
    200     if (isset($_COOKIE['fvcn_post_viewed_' . $id . '_' . COOKIEHASH])) {
    201         return $template;
    202     }
    203200
    204201    $postMapper = fvcn_container_get(\FvCommunityNews\Post\Mapper::class);
    205202    $postMapper->increasePostViewCount($id);
    206203
    207     setcookie('fvcn_post_viewed_' . $id . '_' . COOKIEHASH, 'true', 0, COOKIEPATH, COOKIE_DOMAIN);
    208 
    209204    return $template;
    210205}
  • fv-community-news/tags/3.2.2/src/Version.php

    r1806332 r1843050  
    44
    55use FvCommunityNews;
     6use FvCommunityNews\Syncer\Api\Api;
     7use FvCommunityNews\Syncer\Api\Exception as ApiException;
     8use FvCommunityNews\Syncer\Api\Request as ApiRequest;
    69
    710/**
     
    1518     * @var string
    1619     */
    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;
    2621
    2722    /**
     
    3227    public static function getCurrentVersion()
    3328    {
    34         return self::CURRENT_VERSION;
     29        return FvCommunityNews::VERSION;
    3530    }
    3631
     
    4237    public static function getLatestVersion()
    4338    {
    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            }
    4555
    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);
    6158                self::$latestVersion = $data['version'];
    6259            }
  • fv-community-news/trunk/config/default.config.php

    r1810381 r1843050  
    3131     */
    3232    '_fvcn_is_anonymous_allowed' => true,
     33
     34    /**
     35     * @var bool Whether syncing posts to the API is enabled
     36     */
     37    '_fvcn_syncer_enabled' => true,
    3338
    3439    /**
  • fv-community-news/trunk/config/services.config.php

    r1810381 r1843050  
    2020use FvCommunityNews\Factory\Hook\EnqueueScripts as EnqueueScriptsHookFactory;
    2121use FvCommunityNews\Factory\Hook\Init as InitHookFactory;
     22use FvCommunityNews\Factory\Hook\Syncer as SyncerHookFactory;
    2223use FvCommunityNews\Factory\Post\Controller as PostControllerFactory;
    2324use FvCommunityNews\Factory\Post\Form as PostFormFactory;
     25use FvCommunityNews\Factory\Syncer\Syncer as SyncerFactory;
    2426use FvCommunityNews\Factory\View\AjaxForm as AjaxFormFactory;
    2527use FvCommunityNews\Hook\Akismet as AkismetHook;
     
    2830use FvCommunityNews\Hook\Head as HeadHook;
    2931use FvCommunityNews\Hook\Init as InitHook;
     32use FvCommunityNews\Hook\Syncer as SyncerHook;
    3033use FvCommunityNews\Hook\WidgetsInit as WidgetsInitHook;
    3134use FvCommunityNews\Post\Controller as PostController;
    3235use FvCommunityNews\Post\Mapper as PostMapper;
    3336use FvCommunityNews\Post\Form as PostForm;
     37use FvCommunityNews\Syncer\Syncer;
    3438use FvCommunityNews\View\AjaxForm;
    3539
     
    4953    AkismetHandler::class       => AkismetHandlerFactory::class,
    5054
     55    Syncer::class               => SyncerFactory::class,
     56
    5157    AkismetHook::class          => AkismetHookFactory::class,
    5258    EnqueueScriptsHook::class   => EnqueueScriptsHookFactory::class,
     
    5460    InitHook::class             => InitHookFactory::class,
    5561    PostControllerHook::class   => PostControllerHookFactory::class,
     62    SyncerHook::class           => SyncerHookFactory::class,
    5663    WidgetsInitHook::class      => InvokableFactory::class,
    5764
  • fv-community-news/trunk/fv-community-news.php

    r1825546 r1843050  
    55 * Plugin URI:  https://frankverhoeven.me/wordpress-plugin-fv-community-news/
    66 * Description: Allow visitors of your site to submit articles.
    7  * Version:     3.2.1
     7 * Version:     3.2.2
    88 * Author:      Frank Verhoeven
    99 * Author URI:  https://frankverhoeven.me/
  • fv-community-news/trunk/readme.txt

    r1825546 r1843050  
    66Requires at least:  4.8
    77Tested up to:       4.9
    8 Stable tag:         3.2.1
     8Stable tag:         3.2.2
    99
    1010Give the visitors of your site the ability to submit their news to you, and list it in a nice news feed.
     
    134134
    135135
     136= 3.2.2 =
     137
     138* Fix: Various bugfixes & improvements.
     139
     140
    136141= 3.2.1 =
    137142
    138 * Fix: PHP 7.0 Compatiblity
     143* Fix: PHP 7.0 Compatiblity.
    139144
    140145
  • fv-community-news/trunk/src/Hook/Collection.php

    r1825546 r1843050  
    5252        'fvcn_ready' => [
    5353            Akismet::class,
     54            Syncer::class,
    5455        ],
    5556    ];
  • fv-community-news/trunk/src/Template/common-functions.php

    r1810381 r1843050  
    198198
    199199    $id = (int) fvcn_get_post_id();
    200     if (isset($_COOKIE['fvcn_post_viewed_' . $id . '_' . COOKIEHASH])) {
    201         return $template;
    202     }
    203200
    204201    $postMapper = fvcn_container_get(\FvCommunityNews\Post\Mapper::class);
    205202    $postMapper->increasePostViewCount($id);
    206203
    207     setcookie('fvcn_post_viewed_' . $id . '_' . COOKIEHASH, 'true', 0, COOKIEPATH, COOKIE_DOMAIN);
    208 
    209204    return $template;
    210205}
  • fv-community-news/trunk/src/Version.php

    r1806332 r1843050  
    44
    55use FvCommunityNews;
     6use FvCommunityNews\Syncer\Api\Api;
     7use FvCommunityNews\Syncer\Api\Exception as ApiException;
     8use FvCommunityNews\Syncer\Api\Request as ApiRequest;
    69
    710/**
     
    1518     * @var string
    1619     */
    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;
    2621
    2722    /**
     
    3227    public static function getCurrentVersion()
    3328    {
    34         return self::CURRENT_VERSION;
     29        return FvCommunityNews::VERSION;
    3530    }
    3631
     
    4237    public static function getLatestVersion()
    4338    {
    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            }
    4555
    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);
    6158                self::$latestVersion = $data['version'];
    6259            }
Note: See TracChangeset for help on using the changeset viewer.