{"id":33585,"date":"2015-01-06T14:53:08","date_gmt":"2015-01-06T14:53:08","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/server-side-google-search\/"},"modified":"2015-08-17T16:59:39","modified_gmt":"2015-08-17T16:59:39","slug":"server-side-google-search","status":"publish","type":"plugin","link":"https:\/\/scn.wordpress.org\/plugins\/server-side-google-search\/","author":14199323,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.3","stable_tag":"1.0.3","tested":"4.3.34","requires":"3.7","requires_php":"","requires_plugins":"","header_name":"Server-Side Google Search","header_author":"Aptivate","header_description":"","assets_banners_color":"","last_updated":"2015-08-17 16:59:39","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/aptivate\/server-side-google-search","header_author_uri":"http:\/\/www.aptivate.org\/","rating":0,"author_block_rating":0,"active_installs":10,"downloads":2251,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":{"1.0.0":"<ul>\n<li>First version<\/li>\n<\/ul>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.0.1","1.0.2","1.0.3"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[150,32903,3019,55677,55676],"plugin_category":[],"plugin_contributors":[92830],"plugin_business_model":[],"class_list":["post-33585","plugin","type-plugin","status-publish","hentry","plugin_tags-google","plugin_tags-google-custom-search","plugin_tags-google-search","plugin_tags-sce","plugin_tags-server-side-google-search","plugin_contributors-aptivate","plugin_committers-aptivate"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/server-side-google-search.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>This plugin adds Google Custom Search to your website, but unlike other plugins\noperates on the server side, thus eliminating the need for JavaScript and\nkeeping the page size small.<\/p>\n\n<p>The admin interface is based on that used by the [WP Google Search plugin]\n(https:\/\/wordpress.org\/plugins\/wp-google-search\/)<\/p>\n\n<p>The interface with the Google API is based on <a href=\"https:\/\/github.com\/jasonclark\/digital-collections-custom-search-api\">Digital Collection Search<\/a> by Jason Clark for Montana\nState University.<\/p>\n\n<h4>Available languages<\/h4>\n\n<ul>\n<li>English<\/li>\n<li>Spanish (incomplete)<\/li>\n<\/ul>\n\n<p><a href=\"https:\/\/github.com\/aptivate\/server-side-google-search\">Follow this project on Github<\/a><\/p>\n\n<h3>Development<\/h3>\n\n<p>This plugin uses <a href=\"http:\/\/wp-cli.org\/\">wp-cli<\/a> and <a href=\"https:\/\/phpunit.de\/\">PHPUnit<\/a> for testing.\nThe tests require <a href=\"https:\/\/github.com\/zenovich\/runkit\">runkit<\/a> for mocking functions.<\/p>\n\n<ul>\n<li><p>Grab the latest source from github:<\/p>\n\n<p>$ git clone git@github.com:aptivate\/server-side-google-search.git<\/p><\/li>\n<li><p>Install <a href=\"http:\/\/wp-cli.org\/#install\">wp-cli<\/a><\/p><\/li>\n<li>Install <a href=\"https:\/\/phpunit.de\/\">PHPUnit<\/a><\/li>\n<li><p>Set up runkit:<\/p>\n\n<p>$ git clone https:\/\/github.com\/zenovich\/runkit.git\n$ cd runkit\n$ phpize\n$ .\/configure\n$ sudo make install<\/p><\/li>\n<\/ul>\n\n<p>Add the following lines to <code>\/etc\/php5\/cli\/php.ini<\/code>:<\/p>\n\n<pre><code>extension=runkit.so\nrunkit.internal_override=1\n<\/code><\/pre>\n\n<ul>\n<li><p>Install the test WordPress environment:<\/p>\n\n<p>cd server-side-google-search\nbash bin\/install-wp-tests.sh test_db_name db_user 'db_password' db_host version<\/p><\/li>\n<\/ul>\n\n<p>where:\n** <code>test_db_name<\/code> is the name for your <strong>temporary<\/strong> test WordPress database\n** <code>db_user<\/code> is the database user name\n** <code>db_password<\/code> is the password\n** <code>db_host<\/code> is the database host (eg <code>localhost<\/code>)\n** <code>version<\/code> is the version of WordPress (eg <code>4.2.2<\/code> or <code>latest<\/code>)<\/p>\n\n<ul>\n<li>Run the tests\nphpunit<\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Upload the plugin to the <code>\/wp-content\/plugins\/<\/code> directory.<\/li>\n<li>Activate it through the <strong>Plugins<\/strong> menu in WordPress.<\/li>\n<li>Register your Google Custom Search Engine and get your Google Search Engine ID and API key here: https:\/\/www.google.com\/cse\/<\/li>\n<li>Enable the plugin and enter the Google Search Engine ID and API key (<strong>Settings<\/strong> -&gt; <strong>Server-Side Google Search<\/strong>)<\/li>\n<li>If necessary, add the default search widget to the sidebar where you want to see it<\/li>\n<li>Put the Server-Side Google Search widget on the sidebar where you want to see the results<\/li>\n<li>Your theme will need to override the page that displays the \"Nothing Found\"\nmessage when the search results are displayed.<\/li>\n<\/ol>\n\n<h4>Example of how to add custom metadata to search results<\/h4>\n\n<p>In your header.php:<\/p>\n\n<pre><code>&lt;!--\n&lt;PageMap&gt;\n    &lt;DataObject type=\"post_metadata\"&gt;\n        &lt;Attribute name=\"modified_date\" value=\"&lt;?php the_modified_date( \"M d, Y\", '', '', true ); ?&gt;\" \/&gt;\n    &lt;\/DataObject&gt;\n&lt;\/PageMap&gt;\n--&gt;\n<\/code><\/pre>\n\n<p>In your functions.php:<\/p>\n\n<pre><code>function add_modified_date( $metadata, $item_data ) {\n    return $metadata . sprintf(\n        'Last modified on: %s',\n        $item_data['pagemap']['post_metadata'][0]['modified_date']\n    );\n}\n\nadd_filter( 'ssgs-add-post-search-metadata',\n            'add_modified_date', 10, 2 );\n<\/code><\/pre>\n\n<!--section=changelog-->\n<h4>1.0.3<\/h4>\n\n<ul>\n<li>Removed deprecation warnings for WordPress 4.3<\/li>\n<li>Fixed potential bug where sort argument wasn't being preserved in links<\/li>\n<li>Updated test infrastructure to use wp-cli<\/li>\n<li>Documentation updates<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Added filter to allow custom metadata in search results<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Made display of URLs in search results optional (displayed by default)<\/li>\n<li>Right aligned sort options in search results<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>First version<\/li>\n<\/ul>","raw_excerpt":"Adds a lightweight Google Custom Search to your website, without the need for JavaScript.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/scn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/33585","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/scn.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/scn.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=33585"}],"author":[{"embeddable":true,"href":"https:\/\/scn.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/aptivate"}],"wp:attachment":[{"href":"https:\/\/scn.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=33585"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/scn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=33585"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/scn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=33585"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/scn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=33585"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/scn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=33585"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/scn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=33585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}