{"id":4974,"date":"2009-03-10T12:23:17","date_gmt":"2009-03-10T12:23:17","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/simplehitcounter\/"},"modified":"2009-03-10T12:23:56","modified_gmt":"2009-03-10T12:23:56","slug":"simplehitcounter","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/simplehitcounter\/","author":2082912,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0","stable_tag":"1.0","tested":"2.7.1","requires":"2.7.1","requires_php":"","requires_plugins":"","header_name":"Simple Hit Counter","header_author":"Paul A Jungwirth","header_description":"","assets_banners_color":"","last_updated":"2009-03-10 12:23:56","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/jungwirths.com\/2009\/03\/simple-wordpress-hit-counter-plugin\/","header_author_uri":"http:\/\/jungwirths.com\/","rating":0,"author_block_rating":0,"active_installs":200,"downloads":27937,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0"],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[869],"plugin_category":[36],"plugin_contributors":[82502],"plugin_business_model":[],"class_list":["post-4974","plugin","type-plugin","status-closed","hentry","plugin_tags-counter","plugin_category-analytics","plugin_contributors-pjungwir","plugin_committers-pjungwir"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/simplehitcounter.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>This is the simplest hit counter I could imagine (well, almost). Every time a \npage is requested, it adds one to the count. The display is not an image, just \ntext. There is no javascript to hit some third-party server, no tracking, no \ndistinction among pages: just an old-fashioned site counter CGI, implemented in \nWordPress. The plugin stores its count in its own MySQL table.<\/p>\n\n<p>Once the plugin is installed (described below), you can display the count by \nputting code like this somewhere on your page:<\/p>\n\n<pre><code>&lt;?= simplehitcounter_hit(); ?&gt;\n<\/code><\/pre>\n\n<p>That will both increment the counter and display its value. There is no method \nfor getting the value without incrementing it. I suppose I could write such a \nthing if anyone likes.<\/p>\n\n<p>There is a minor race condition. First the plugin updates the database by one \n(atomically), then it queries for the current count. Therefore in heavy traffic \nit is possible for two updates to happen before either select. In that case, \nthe counter will correctly increment, but the number displayed may be the same \nfor each user, representing the total page hits. As far as I can tell, this \nrace condition is inevitable without locking the table. It seems trivial \nenough, though I guess you should be warned if you run a contest to give away a \nfree car to the 1,000,000th user.<\/p>\n\n<p>By default the plugin keeps its data in a table called <code>wp_simplehitcounter_hits<\/code>.\nYou can change this by editing the <code>simplehitcounter.php<\/code> file.<\/p>\n\n<!--section=installation-->\n<p>Installing the plugin is easy and follows the standard steps:<\/p>\n\n<ol>\n<li>Upload <code>simplehitcounter.php<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory.<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress.<\/li>\n<li>Place <code>&lt;?= simplehitcounter_hit(); ?&gt;<\/code> somewhere like the footer or sidebar.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>Why did you write such a boring plugin?<\/dt>\n<dd><p>Why do you ask such boring questions?<\/p><\/dd>\n<dt>Why didn't you use the other plugin x?<\/dt>\n<dd><p>I looked around, but everything seemed too fancy. Besides, I wanted a chance to \nwrite my own WordPress plugin.<\/p><\/dd>\n\n<\/dl>","raw_excerpt":"Prints a count of the number of hits your blog has received, tracked in the \ndatabase.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/4974","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=4974"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/pjungwir"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=4974"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=4974"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=4974"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=4974"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=4974"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=4974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}